Add a Filter to the available filter list
Throws an Exception if the Closure $filter does not produce a Filter object

@param $filterName
@param \Closure $filter
@throws \Exception
10607
protected function addFilter($filterName, \Closure $filter) {
        $filter = call_user_func($filter);
        if(!is_a($filter, 'SypherLev\Blueprint\Elements\Filter')) {
            throw (new \Exception('Filter named '.$filterName. ' could not be added; Closure does not return a valid Filter object'));
        }
        $this->filters[$filterName] = $filter;
    }
1327833
public function getFilterValue($filterName)
    {
        if (isset($this->input['filters'][$filterName])) {
            return $this->input['filters'][$filterName];
        } else {
            return null;
        }
    }
1179190
protected function registerClosureFilter(Closure $filter)
	{
		$this->getRouter()->filter($name = spl_object_hash($filter), $filter);

		return $name;
	}
1236287
public function addFilter(/*$filter, $args ...*/)
    {
        $args = func_get_args();
        $filter = array_shift($args);
        $this->filters []= sprintf('%s(%s)', $filter, implode(',', $args));
    }
97314
public function addFilter(Filter $filter)
    {
        $key = $filter->getKey();
        $this->filters[$key] = $filter;
    }
586236
public function addFilter(FilterInterface $filter, $placement = self::CHAIN_APPEND)
    {
        if ($placement == self::CHAIN_PREPEND) {
            array_unshift($this->filters, $filter);
        } else {
            $this->filters[] = $filter;
        }

        return $this;
    }
77082
public function filter ($filtername)
	{
		$arguments = func_get_args ();
		array_shift ($arguments);

		$filters = explode (',', $filtername);
		foreach ($filters as $filter)
		{
			$objfilter = new Filter ($filter);
			$objfilter->setArguments ($arguments);

			$this->filters[] = $objfilter;
		}

		return $this;
	}
755233
protected function withFilter($filterName) {
        if(!isset($this->filters[$filterName])) {
            throw (new \Exception('Could not set filter '.$filterName.': filter not found'));
        }
        $this->activeFilters[] = $filterName;
        return $this;
    }
1319541
public function addFilter($rule, $callback)
    {
        $method = 'filter_'.$rule;

        if (method_exists(__CLASS__, $method) || isset(self::$filter_methods[$rule])) {
            throw new Exception("Filter rule '$rule' already exists.");
        }

        self::$filter_methods[$rule] = $callback;

        return $this;
    }
1121646
public function add_filter($field, $filter) {

		if(!is_callable($filter)) return $this;

		if(!isset($this->filters[$field])) $this->filters[$field] = array();
		$this->filters[$field][] = $filter;

		return $this;

	}
592787
public function make($filterName)
    {
        if ($this->validator && !$this->validator->validate($filterName)) {
            return null;
        }

        if ($this->transformer) {
            $class = __NAMESPACE__ . '\\' . $this->transformer->transform($filterName);
        } else {
            $class = __NAMESPACE__ . '\\' . $filterName;
        }

        if (!class_exists($class)) {
            return null;
        }

        return new $class();
    }
367145
public function getFilter($filterName = null)
    {
        return isset($this->filters[$filterName])? $this->filters[$filterName] : false;
    }
520432
private function setFilterParameters($name, SQLFilter $filter)
    {
        if (empty($this->filtersParameters[$name])) {
            return;
        }

        $parameters = $this->filtersParameters[$name];
        foreach ($parameters as $paramName => $paramValue) {
            $filter->setParameter($paramName, $paramValue);
        }
    }
36641
private function isFilterable($filter)
    {
        if (is_string($filter) && ! class_exists($filter)) {
            throw new Exceptions\InvalidFilterException(
                "The [$filter] class does not exits."
            );
        }

        if ( ! in_array(Filterable::class, class_implements($filter))) {
            throw new Exceptions\InvalidFilterException(
                'The filter must be a Closure or a class implementing the Filterable interface.'
            );
        }
    }
208616
public function delete(Closure $filter)
    {
        $collectionData = $this->storage->load(true);
        if (!isset($collectionData['items'])) {
            $collectionData['items'] = [];
        }
        $items = &$collectionData['items'];

        foreach ($items as $k => $item) {
            if ($filter($item)) {
                unset($items[$k]);
            }
        }
        $this->storage->save($collectionData);
    }
405344
private function add($filterName, $filterCall, $prio, $numVars)
    {
        $data             = new stdClass();
        $data->filtername = $filterName;
        $data->callback   = $filterCall;
        $data->prio       = $prio;
        $data->numvars    = $numVars;

        return $data;
    }
1003626
public function addFilter(BuilderInterface $filter, $name = '')
    {
        if ($this->anonymous === false && empty($name)) {
            throw new \LogicException('In not anonymous filters filter name must be set.');
        } elseif ($this->anonymous === false && !empty($name)) {
            $this->filters['filters'][$name] = $filter->toArray();
        } else {
            $this->filters['filters'][] = $filter->toArray();
        }

        return $this;
    }