protected function doFiltration(QueryBuilderInterface $queryBuilder)
    {
        $search = $this->getSearchService();

        $filters = $this->map($this->getFilters(), true);
        $query = $search->searchType($queryBuilder, $this->getType(), true);

        foreach ($filters as $filterProp => $filterVal) {
            foreach ($filterVal as $values) {
                if (is_array($values)) {
                    $query->addCriterion($filterProp, SupportedOperatorHelper::IN, $values);
                } elseif (is_string($values)) {
                    $query->addCriterion($filterProp, SupportedOperatorHelper::CONTAIN, $values);
                }
            }
        }

        $queryBuilder->setCriteria($query);
    }
protected function doFiltration(QueryBuilderInterface $queryBuilder)
    {
        $search = $this->getSearchService();

        $filters = $this->map($this->getFilters(), true);
        $query = $search->searchType($queryBuilder, $this->getType(), true);

        foreach ($filters as $filterProp => $filterVal) {
            foreach ($filterVal as $values) {
                if (is_array($values)) {
                    $query->addCriterion($filterProp, SupportedOperatorHelper::IN, $values);
                } elseif (is_string($values)) {
                    $query->addCriterion($filterProp, SupportedOperatorHelper::CONTAIN, $values);
                }
            }
        }

        $queryBuilder->setCriteria($query);
    }
protected function doFiltration ( QueryBuilderInterface $ queryBuilder ) { $ search = $ this -> getSearchService ( ) ; $ filters = $ this -> map ( $ this -> getFilters ( ) , true ) ; $ query = $ search -> searchType ( $ queryBuilder , $ this -> getType ( ) , true ) ; foreach ( $ filters as $ filterProp => $ filterVal ) { foreach ( $ filterVal as $ values ) { if ( is_array ( $ values ) ) { $ query -> addCriterion ( $ filterProp , SupportedOperatorHelper :: IN , $ values ) ; } elseif ( is_string ( $ values ) ) { $ query -> addCriterion ( $ filterProp , SupportedOperatorHelper :: CONTAIN , $ values ) ; } } } $ queryBuilder -> setCriteria ( $ query ) ; }
Apply filters to search query
@param QueryBuilderInterface $queryBuilder
Apply filters to search query