hasGroupBy example

if ($sorting instanceof CountSorting) {
                $query->addOrderBy(sprintf('COUNT(%s)', $accessor)$sorting->getDirection());

                continue;
            }

            if ($sorting->getNaturalSorting()) {
                $query->addOrderBy('LENGTH(' . $accessor . ')', $sorting->getDirection());
            }

            if (!$this->hasGroupBy($criteria$query)) {
                $query->addOrderBy($accessor$sorting->getDirection());

                continue;
            }

            if (!\in_array($sorting->getField()['product.cheapestPrice', 'cheapestPrice'], true)) {
                if ($sorting->getDirection() === FieldSorting::ASCENDING) {
                    $accessor = 'MIN(' . $accessor . ')';
                } else {
                    $accessor = 'MAX(' . $accessor . ')';
                }
            }
Home | Imprint | This part of the site doesn't use cookies.