Use getter or setter
Retained for backward compatibility
@param ODataQueryFilterInterface|null $filter
@return $this|mixed
@deprecated
18397
public function filter(ODataQueryFilterInterface $filter = NULL) {
        if (isset($filter)) {
            $this->setFilter($filter);
            return $this;
        }
        return $this->getFilter();
    }
225069
public function setFilter($filter)
    {
        return $this->filter = is_array($filter) ? self::flexiUrl($filter) : $filter;
    }
979244
public function add($filter)
    {
        if (is_array($filter)) {
            $this->collection[] = new Filter($filter);
        } elseif (is_object($filter) && $filter instanceof Filter) {
            $this->collection[] = $filter;
        }

        return $this;
    }
333220
public function findByFilter(Filter $filter, $limit = null, $offset = 0, $order = null)
    {
        return $this->findByCriteria($filter->getCriteria(), $limit, $offset, $order);
    }
1345549
public function filter($filter)
    {
        if (is_array($filter)) {
            $filter = new GridFilter($filter);
        }

        if ($filter instanceof FilterSpecification) {
            $filter = new GridFilter($filter->asFilter());
        }

        $this->filter = $filter;

        return $this;
    }
423440
public function setFilters(Mutable $filters = null)
    {
        if ($filters) {
            $filters = $filters->map(function ($element) {
                if ($this->request->has($id = $element->id())) {
                    $element->getInput()->setValue(
                        $this->request->get($id)
                    );
                }

                return $element;
            });
        }

        $this->filters = $filters;

        return $this;
    }
525814
public function setFilter(\Sulu\Bundle\ResourceBundle\Entity\Filter $filter)
    {
        $this->filter = $filter;

        return $this;
    }
427562
protected function getEventsFilter(string $filter = null)
    {
        $mappingConfiguration = new PropertyMappingConfiguration();
        $mappingConfiguration->setTypeConverter($this->typeConverterObjectConverter);
        $mappingConfiguration->setTypeConverterOption(\RGU\Dvoconnector\Property\TypeConverter\ObjectConverter::class, \RGU\Dvoconnector\Property\TypeConverter\ObjectConverter::CONFIGURATION_OBJECT, $this->getDefaultEventsFilter());

        return $this->convertEventsFilter($mappingConfiguration, $filter);
    }
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]);
        }
    }
701043
private static function determineFilterLikeOrNotLike(array $filter, QueryBuilder $queryBuilder)
    {
        if (!\in_array($filter['operation'], ['LIKE', 'NOT LIKE'])) {
            return null;
        }

        return static::filterLikeOrNotLike($filter, $queryBuilder);
    }
929366
public function Where(string $filter, array $params = []): QueryBuilder
    {
        $this->filter;
        $this->params = $params;
        
        return $this;
    }
575961
public function setFilter($filter)
    {
        parent::setFilter($filter);

        $this->userOptions['value'] = $this->getOption('value') === '' ? null : $this->getOption('value');
    }
1073029
public function auto_filter($filter = true)
	{
		if (func_num_args() == 0)
		{
			return $this->auto_filter;
		}

		$this->auto_filter = $filter;

		return $this;
	}
486615
public function getFilter($column, $filter = null)
    {
        if (null === $filter) {
            return $this->filters[$column] ?? null;
        }
        return $this->filters[$column][$filter] ?? null;
    }
345929
public function removeByFilter($filter)
    {
        foreach ($this->where($filter) as $item) {
            $this->remove($item);
        }
        return $this;
    }
1128204
public ServerFilter where(Predicate<ServerMetadata> filter) {
        checkNotNull(filter, "Filter must be not a null");

        predicate = predicate.and(filter);

        return this;
    }
821703
private function getEntity($filter)
    {
        $roles = $this->getRepository('\erdiko\users\entities\Role');

        if (isset($filter['id']) && $filter['id'] > 0) {
            $result = $roles->find($filter['id']);
        } else {
            $result = new \erdiko\users\entities\Role();
        }
        return $result;
    }