Add filter

@param EntityFilterInterface $filter
@param null|string $alias
170939
public function add(EntityFilterInterface $filter, $alias = null)
    {
        if (null === $alias) {
            $alias = $filter->getName();
        }
        $this->filters[$alias] = $filter;
    }
131563
public void addFilter(final Filter newFilter) {
    if (headFilter == null) {
      headFilter = newFilter;
      tailFilter = newFilter;
    } else {
      tailFilter.next = newFilter;
      tailFilter = newFilter;
    }
  }
1006205
public function addFilter($filter, $expected = true, $type = null)
	{
		$filter = '#'.$filter.'#';

		$this->filters[] = array(
			'pattern' => $filter,
			'expected' => $expected,
			'type' => $type,
		);
	}
505543
protected function addFilters(FormInterface $form, QueryInterface $filterQuery, $alias = null)
    {
        /** @var $child FormInterface */
        foreach ($form->all() as $child) {
            $formType = $child->getConfig()->getType()->getInnerType();

            // this means we have a relation
            if ($child->getConfig()->hasAttribute('add_shared')) {
                $join = trim($alias . '.' . $child->getName(), '.');

                $addSharedClosure = $child->getConfig()->getAttribute('add_shared');

                if (!$addSharedClosure instanceof \Closure) {
                    throw new \RuntimeException('Please provide a closure to the "add_shared" option.');
                }

                $qbe = new FilterBuilderExecuter($filterQuery, $alias, $this->parts);
                $addSharedClosure($qbe);

                if (!$this->parts->has($join)) {
                    throw new \RuntimeException(sprintf('No alias found for relation "%s".', $join));
                }

                $isCollection = ($formType instanceof CollectionAdapterFilterType);

                $this->addFilters($isCollection ? $child->get(0) : $child, $filterQuery, $this->parts->get($join));

            // Doctrine2 embedded object case
            } elseif ($formType instanceof EmbeddedFilterTypeInterface) {
                $this->addFilters($child, $filterQuery, $alias . '.' . $child->getName());

            // default case
            } else {
                $condition = $this->getFilterCondition($child, $formType, $filterQuery, $alias);

                if ($condition instanceof ConditionInterface) {
                    $this->conditionBuilder->addCondition($condition);
                }
            }
        }
    }
148423
public function setFilter(FilterQuery $filter)
    {
        $this->result = array_merge($this->result, $filter->toArray()['bool']);

        return $this;
    }
223577
public function AddFilter( $filter )
	{
		$this->filters[] = $filter;

		if ( count( $this->filters ) <= 1 ) return;

		usort( $this->filters, function( /** @var Filter $a */ $a, /** @var Filter $b */ $b )
		{
			return $a->sortPriority > $b->sortPriority
				? 1
				: ( $a->sortPriority < $b->sortPriority ? -1 : 0 );
		} );
	}
575740
public function addFilterConditions(FormInterface $form, $queryBuilder, $alias = null)
    {
        // create the right QueryInterface object
        $event = new PrepareEvent($queryBuilder);
        $this->dispatcher->dispatch(FilterEvents::PREPARE, $event);

        if (!$event->getFilterQuery() instanceof QueryInterface) {
            throw new \RuntimeException("Couldn't find any filter query object.");
        }

        $alias = (null !== $alias) ? $alias : $event->getFilterQuery()->getRootAlias();

        // init parts (= ['joins' -> 'alias']) / the root alias does not target a join
        $this->parts->add('__root__', $alias);

        // get conditions nodes defined by the 'filter_condition_builder' option
        // and add filters condition for each node
        $this->conditionBuilder = $this->getConditionBuilder($form);
        $this->addFilters($form, $event->getFilterQuery(), $alias);

        // walk condition nodes to add condition on the query builder instance
        $name = sprintf('lexik_filter.apply_filters.%s', $event->getFilterQuery()->getEventPartName());
        $this->dispatcher->dispatch($name, new ApplyFilterConditionEvent($queryBuilder, $this->conditionBuilder));

        $this->conditionBuilder = null;

        return $queryBuilder;
    }
832002
public function count($entityType, $filter = '')
	{
		$params = array('type_name' => $entityType);
		if (!empty($filter)) {
			$params['filter'] = $filter;
		}
		return $this->post('entity.count', $params);
	}
657855
protected function applySimpleFilter(Filter $filter)
    {
        $value = (array) $filter->getValue();
        if (count($value) > 1) {
            $this->query->whereIn($filter->getField(), $value);
        } else {
            $this->query->where($filter->getField(),
                $filter->getOperator(), $value[0]);
        }
    }
748159
public function addFilter(string $filterName, string $filterClassName) : void
    {
        $this->filters[$filterName] = $filterClassName;
    }
49453
public function withFilter(Filter $filter)
    {
        if ($this->value->isNull()) {
            return null;
        }

        return $this->applyFilter($filter);
    }
413483
public function addFilter(string $name, string $filter): void{
        $this->filters[$name] = $filter;
    }
918905
public function addAlias($alias = null)
    {
        return (new AuthorizationBuilder(TransactionType::ALIAS, $this))
            ->withAlias(AliasAction::ADD, $alias);
    }
411599
public function addFilter(FilterInterface $filter) {
        if ($filter->supportsType($this->getType())) {
            $this->filters[] = $filter;
        }
        return $this;
    }
133704
public function add(callable $filter, $priority = null)
    {
        $this->filters->insert($filter, $priority);

        return $this;
    }
831263
public static function addFilter($filter, $callback = null)
    {
        if (is_array($filter)) {
            $filters = $filter;
            foreach ($filters as $key => $filter) {
                if (is_numeric($key)) {
                    $key = $filter;
                }
                self::addFilter($key, $filter);
            }

            return true;
        } elseif (is_string($filter) && class_exists($filter, false) && is_subclass_of($filter, 'FilterCollection')) {
            foreach (get_class_methods($filter) as $f) {
                if (is_callable(array($filter, $f))) {
                    self::$filters[$f] = array($filter, $f);
                }
            }

            return true;
        }
        if (is_null($callback)) {
            $callback = $filter;
        }

        if (!is_callable($callback)) {
            return false;
        }
        self::$filters[$filter] = $callback;
    }
629043
public void addFilter(final String columnFamily, Filter filter)
    {
        FilterList filterList = this.filters.get(columnFamily);
        if (filterList == null)
        {
            filterList = new FilterList();
        }
        if (filter != null)
        {
            filterList.addFilter(filter);
        }
        this.filters.put(columnFamily, filterList);
    }