Search\Manager::loadFilter PHP Method

loadFilter() public method

Loads a search filter.
public loadFilter ( string $name, string $filter, array $options = [] ) : Base
$name string Name of the field
$filter string Filter name
$options array Filter options.
return Search\Model\Filter\Base
    public function loadFilter($name, $filter, array $options = [])
    {
        if (empty($options['className'])) {
            $class = Inflector::classify($filter);
        } else {
            $class = $options['className'];
            unset($options['className']);
        }
        $className = App::className($class, 'Model\\Filter');
        if (!class_exists($className)) {
            throw new InvalidArgumentException(sprintf('Search filter "%s" was not found.', $class));
        }
        return new $className($name, $this, $options);
    }