Add any filters to the query criteria.

@return void
762854
private function addFilterCriteria()
    {
        $filters = $this->dm->getFilterCollection()->getFilterCriteria($this->class);

        foreach ($filters as $filter) {
            $this->addCriteria($filter);
        }
    }
835404
protected function _prepare_filter() {
		$post = \get_queried_object();

		if ( ! empty( $post->post_name ) ) {
			$this->slug = $post->post_name;
		}

		if ( ! empty( $post->post_type ) ) {
			$post_type       = \get_post_type_object( $post->post_type );
			$this->post_type = $post_type->name;
		}
	}
891926
public function addConstraints()
    {
        if (static::$constraints) {
            $this->query->where($this->foreignKey, '=', $this->getParentKey());

            $this->query->whereNotNull($this->foreignKey);
        }
    }
1200004
def build_filters(self, view, filters=None):
        
        query_builder = self.get_query_builder(backend=self, view=view)
        return query_builder.build_query(**(filters if filters else {}))
1003741
protected function _setupFilters()
    {
        if (!($this->_filterEnabled = $this->_isFilterEnabled())) {
            return;
        }

        $this->filterFields = $this->_getFilterFields();
        $sluggedFilter = $this->request->getParam('sluggedFilter', '');

        if ($sluggedFilter === '') {
            return;
        }

        $filterData = $this->Filters->find('filterDataBySlug', ['request' => $this->request]);

        if (empty($filterData)) {
            return;
        }

        $data = array_merge($this->request->getData(), $filterData);
        foreach ($data as $key => $value) {
            $this->request = $this->request->withData($key, $value);
        }
        $this->slug = $sluggedFilter;
    }
591308
protected function generateFilters()
    {

        $filters = $this->request->query->get('filters');

        $filters = json_decode($filters, true);
        $rules = $filters['rules'];
        $groupOp = $filters['groupOp']; //AND or OR

        if ($rules) {
            foreach ($rules as $rule) {
                foreach ($this->columns as $column) {
                    if ($column->getFieldIndex() == $rule['field']) {
                        $filterMapper = FilterMapperFactory::getFilterMapper($this, $column);
                        $filterMapper->execute($rule, $groupOp);
                    }
                }
            }
        }
    }
96843
protected function initFilters()
    {
        // If override status is set in field options to true
        // we will change filtersOverride property value to true
        // so we can override existing filters with registered
        // alias/name in addFilter method.
        $overrideStatus = $this->getOption('filters_override', false);
        if ($overrideStatus) {
            $this->setFiltersOverride(true);
        }

        // Get filters and bind it to field.
        $filters = $this->getOption('filters', []);
        foreach ($filters as $filter) {
            $this->addFilter($filter);
        }

        return $this;
    }
1299331
private function createQueryFilter()
    {
        if (count($this->queryFilter()) > 0) {
            foreach ($this->queryFilter() as $filter => $parameters) {
                if (!is_array($parameters)) {
                    $parameters = [$parameters];
                }
                $this->query = call_user_func_array([$this->query, $filter], $parameters);
            }
        }
    }
628974
private function constructFilters()
    {
        foreach ($this->filters as $filter_name => $filter_options) {
            $this->filterObjects[] = new TableFilter(
                $this->request,
                $filter_name,
                $filter_options
            );
        }
    }
1292623
public function buildFilters()
    {
	$this->addFilter('type', new ORM\EnumerationFilterType('type'), 'Type', array_combine(Bike::$types, Bike::$types));
	$this->addFilter('brand', new ORM\StringFilterType('brand'), 'Brand');
	$this->addFilter('model', new ORM\StringFilterType('model'), 'Model');
	$this->addFilter('price', new ORM\NumberFilterType('price'), 'Price');
    }
663590
protected function initFilters($query)
    {
        if ($value = $this->getParamAdapter()->getValueOfFilter('name')) {
            $query->where($query->expr()->like('q.name', '?1'))->setParameter('1', '%' . $value . '%');
        }

        if ($value = $this->getParamAdapter()->getValueOfFilter('surname')) {
            $query->where($query->expr()->like('q.surname', '?1'))->setParameter('1', '%' . $value . '%');
        }

        if ($value = $this->getParamAdapter()->getValueOfFilter('doctrine')) {
            $query->where("q.name like '%".$value."%' OR q.surname like '%".$value."%' ");
            $expr = $query->expr();
            $query->where($expr->orX($expr->like('q.name', '?1'), $expr->like('q.surname', '?2')))
                ->setParameter('1', '%' . $value . '%')
                ->setParameter('2', '%' . $value . '%');
        }

        if ($value = $this->getParamAdapter()->getValueOfFilter('street')) {
            $query->where($query->expr()->like('q.street', '?1'))->setParameter('1', '%' . $value . '%');
        }

        if ($value = $this->getParamAdapter()->getValueOfFilter('city')) {
            $query->where($query->expr()->like('q.city', '?1'))->setParameter('1', '%' . $value . '%');
        }

        if ($value = $this->getParamAdapter()->getValueOfFilter('product')) {
            $query->where($query->expr()->like('q.product', '?1'))->setParameter('1', '%' . $value . '%');
        }
    }
805248
protected function addAllSelectColumns()
        {
            foreach ($this->getTable()->getAliasColumns() as $column) {
                $this->query->addSelectionColumnRaw($column);
            }

            foreach ($this->query->getJoins() as $join) {
                foreach ($join->getTable()->getAliasColumns() as $column) {
                    $this->query->addSelectionColumnRaw($column);
                }
            }
        }
222685
public function initFilters()
    {

        //Only run on frontend
        if (is_admin()) {
            return;
        }

        global $wp_query;

        if ((is_category() || is_tax() || is_tag()) && !get_post_type()) {
            $postType = 'post';
        }

        $postType = get_post_type();

        if (!$postType && isset($wp_query->query['post_type'])) {
            $postType = $wp_query->query['post_type'];
        }

        if (!$postType) {
            return;
        }

        $queriedObject = get_queried_object();
        $objectId = null;
        if (isset($queriedObject->ID)) {
            $objectId = $queriedObject->ID;
        }

        $pageForPosts = get_option('page_for_' . get_post_type());

        if (($pageForPosts !== $objectId && !is_archive() && !is_post_type_archive() && !is_home() && !is_category() && !is_tax() && !is_tag()) || is_admin()) {
            return;
        }

        add_action('Municipio/viewData', function ($data) use ($wp_query, $postType) {

            //Get current post type enabledTaxonomyFilters
            if (!isset($data['postType']) || !$data['postType']) {
                $data['postType'] = $postType;
            }

            //Get header filters
            if ($enabledHeaderFilters = get_field('archive_' . $data['postType'] . '_post_filters_header', 'option')) {
                $data['enabledHeaderFilters'] = $enabledHeaderFilters;
            } else {
                $data['enabledHeaderFilters'] = array();
            }

            //Get taxonomy filters
            if ($enabledTaxonomyFilters = $this->getEnabledTaxonomies($data['postType'])) {
                $data['enabledTaxonomyFilters'] = $enabledTaxonomyFilters;
            } else {
                $data['enabledTaxonomyFilters'] = array();
            }

            //Is query string present?
            $data['queryString'] = (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) ? true : false;

            //The archive url
            $data['archiveUrl'] = $this->getArchiveSlug($postType);

            $data['searchQuery'] = $this->getSearchQuery();

            return $data;
        });
    }
423977
protected function addTypoScriptFilters()
    {
        if (!empty($this->settings['additionalFilters'])) {
            foreach ($this->settings['additionalFilters'] as $key => $filterQuery) {
                $this->query->createFilterQuery('additionalFilter-'.$key)
                    ->setQuery($filterQuery);
            }
        }

        return $this;
    }
926835
def addFilter(self, filterclass):
        """"""
        if filterclass not in self.filters:
            self.filters.append(filterclass)
619738
public function AddFilter(CriteriaFilter $filter)
	{
		if (!$this->Filters) $this->Filters = array();
		$this->Filters[] = $filter;
	}
933994
def set_filters(query, base_filters):
    
    filters = [f for f in base_filters if f is not None]
    query_filter = query['query']['filtered'].get('filter', None)
    if query_filter is not None:
        if 'and' in query_filter:
            filters.extend(query_filter['and'])
        else:
            filters.append(query_filter)
    if filters:
        query['query']['filtered']['filter'] = {'and': filters}