public static function instance($filter)
    {
        if (!is_string($filter)) {
            return self::validateFilterInstance($filter);
        }

        if (class_exists($filter)) {
            return self::validateFilterInstance(new $filter());
        }

        if ($filter = FilterResolver::resolveFromCollection($filter)) {
            return self::validateFilterInstance($filter);
        }

        $ex = new UnableToResolveFilterException();
        throw $ex;
    }
public static function instance($filter)
    {
        if (!is_string($filter)) {
            return self::validateFilterInstance($filter);
        }

        if (class_exists($filter)) {
            return self::validateFilterInstance(new $filter());
        }

        if ($filter = FilterResolver::resolveFromCollection($filter)) {
            return self::validateFilterInstance($filter);
        }

        $ex = new UnableToResolveFilterException();
        throw $ex;
    }
public static function instance ( $ filter ) { if ( ! is_string ( $ filter ) ) { return self :: validateFilterInstance ( $ filter ) ; } if ( class_exists ( $ filter ) ) { return self :: validateFilterInstance ( new $ filter ( ) ) ; } if ( $ filter = FilterResolver :: resolveFromCollection ( $ filter ) ) { return self :: validateFilterInstance ( $ filter ) ; } $ ex = new UnableToResolveFilterException ( ) ; throw $ ex ; }
Method instance used to resolve filter parameter to
FilterInterface object from filter Alias or object itself.

@param  mixed $filter

@return FilterInterface

@throws Exception\UnableToResolveFilterException
@throws Exception\InvalidInstanceException
Method instance used to resolve filter parameter to FilterInterface object from filter Alias or object itself .