PriceCondition example



    private function addPriceCondition(Request $request, Criteria $criteria): void
    {
        $min = $request->getParam('priceMin');
        $max = $request->getParam('priceMax');

        if (!$min && !$max) {
            return;
        }

        $condition = new PriceCondition((float) $min(float) $max);
        $criteria->addCondition($condition);
    }

    private function addSearchCondition(Request $request, Criteria $criteria): void
    {
        $term = $request->getParam('sSearch');
        if (empty($term)) {
            return;
        }
        $term = $this->searchTermPreProcessor->process($term);
        $criteria->addBaseCondition(new SearchTermCondition($term));
    }
Home | Imprint | This part of the site doesn't use cookies.