code/filter/factory.php
public function createFilter($filter, $config = array())
    {
        if(is_string($filter) && strpos($filter, '.') === false )
        {
            $identifier = $this->getIdentifier()->toArray();
            $identifier['name'] = $filter;
        }
        else $identifier = $filter;

        $filter = $this->getObject($identifier, $config);

        //Check the filter interface
        if(!($filter instanceof FilterInterface)) {
            throw new \UnexpectedValueException('Filter:'.get_class($filter).' does not implement FilterInterface');
        }

        return $filter;
    }
public function createFilter($filter, $config = array())
    {
        if(is_string($filter) && strpos($filter, '.') === false )
        {
            $identifier = $this->getIdentifier()->toArray();
            $identifier['name'] = $filter;
        }
        else $identifier = $filter;

        $filter = $this->getObject($identifier, $config);

        //Check the filter interface
        if(!($filter instanceof FilterInterface)) {
            throw new \UnexpectedValueException('Filter:'.get_class($filter).' does not implement FilterInterface');
        }

        return $filter;
    }
public function createFilter ( $ filter , $ config = array ( ) ) { if ( is_string ( $ filter ) && strpos ( $ filter , '.' ) === false ) { $ identifier = $ this -> getIdentifier ( ) -> toArray ( ) ; $ identifier [ 'name' ] = $ filter ; } else $ identifier = $ filter ; $ filter = $ this -> getObject ( $ identifier , $ config ) ; //Check the filter interface if ( ! ( $ filter instanceof FilterInterface ) ) { throw new \ UnexpectedValueException ( 'Filter:' . get_class ( $ filter ) . ' does not implement FilterInterface' ) ; } return $ filter ; }
Factory method for Filter classes.

If the filter is not an identifier this function will create it directly instead of going through the Object
identification process.

@param   string  $filter Filter identifier
@param   object|array $config     An optional ObjectConfig object with configuration options
@throws	\UnexpectedValueException	When the filter does not implement FilterInterface
@return  FilterInterface
Factory method for Filter classes .