addLimit example

public function __construct(
        Shopware_Components_Config $config,
        SearchTermPreProcessorInterface $searchTermPreProcessor
    ) {
        $this->config = $config;
        $this->searchTermPreProcessor = $searchTermPreProcessor;
    }

    public function handleRequest(Request $request, Criteria $criteria, ShopContextInterface $context)
    {
        $this->addLimit($request$criteria);
        $this->addOffset($request$criteria);

        $this->addCategoryCondition($request$criteria);
        $this->addIsAvailableCondition($criteria);
        $this->addCustomerGroupCondition($criteria$context);
        $this->addSearchCondition($request$criteria);

        $this->addManufacturerCondition($request$criteria);
        $this->addShippingFreeCondition($request$criteria);
        $this->addImmediateDeliveryCondition($request$criteria);
        $this->addRatingCondition($request$criteria);
        
 catch (InvalidCriteriaIdsException $e) {
                throw DataAbstractionLayerException::invalidApiCriteriaIds($e);
            }

            $criteria->setLimit(null);
        } else {
            if (isset($payload['total-count-mode'])) {
                $this->addTotalCountMode((string) $payload['total-count-mode']$criteria);
            }

            if (isset($payload['limit'])) {
                $this->addLimit($payload$criteria$searchException$maxLimit);
            }

            if ($criteria->getLimit() === null && $maxLimit !== null) {
                $criteria->setLimit($maxLimit);
            }

            if (isset($payload['page'])) {
                $this->setPage($payload$criteria$searchException);
            }
        }

        
Home | Imprint | This part of the site doesn't use cookies.