public function applyFilters(QueryBuilder $qb)
    {
        foreach ($this->getFilters() as $filter) {

            $type = null;
            $placeholder = $filter['valuePlaceholder'];
            if (is_array($filter['value'])) {
                $type = Connection::PARAM_STR_ARRAY;
                $filter['valuePlaceholder'] = '(' . $placeholder . ')';
            }

            $qb->andWhere($filter['column'] .' '. $filter['operator'] .' '. $filter['valuePlaceholder'])
                ->setParameter($placeholder, $filter['value'], $type);
        }

        return $qb;
    }
public function applyFilters(QueryBuilder $qb)
    {
        foreach ($this->getFilters() as $filter) {

            $type = null;
            $placeholder = $filter['valuePlaceholder'];
            if (is_array($filter['value'])) {
                $type = Connection::PARAM_STR_ARRAY;
                $filter['valuePlaceholder'] = '(' . $placeholder . ')';
            }

            $qb->andWhere($filter['column'] .' '. $filter['operator'] .' '. $filter['valuePlaceholder'])
                ->setParameter($placeholder, $filter['value'], $type);
        }

        return $qb;
    }
public function applyFilters ( QueryBuilder $ qb ) { foreach ( $ this -> getFilters ( ) as $ filter ) { $ type = null ; $ placeholder = $ filter [ 'valuePlaceholder' ] ; if ( is_array ( $ filter [ 'value' ] ) ) { $ type = Connection :: PARAM_STR_ARRAY ; $ filter [ 'valuePlaceholder' ] = '(' . $ placeholder . ')' ; } $ qb -> andWhere ( $ filter [ 'column' ] . ' ' . $ filter [ 'operator' ] . ' ' . $ filter [ 'valuePlaceholder' ] ) -> setParameter ( $ placeholder , $ filter [ 'value' ] , $ type ) ; } return $ qb ; }
Apply the filters

@param QueryBuilder $qb
@return QueryBuilder
Apply the filters