lib/DataSift/StreamConsumer.php
public static function factory($user, $type, $definition, $eventHandler)
    {
        $classname = 'DataSift_StreamConsumer_' . $type;
        if (! class_exists($classname)) {
            throw new DataSift_Exception_InvalidData('Consumer type "' . $type . '" is unknown');
        }

        return new $classname($user, $definition, $eventHandler);
    }
public static function factory($user, $type, $definition, $eventHandler)
    {
        $classname = 'DataSift_StreamConsumer_' . $type;
        if (! class_exists($classname)) {
            throw new DataSift_Exception_InvalidData('Consumer type "' . $type . '" is unknown');
        }

        return new $classname($user, $definition, $eventHandler);
    }
public static function factory ( $ user , $ type , $ definition , $ eventHandler ) { $ classname = 'DataSift_StreamConsumer_' . $ type ; if ( ! class_exists ( $ classname ) ) { throw new DataSift_Exception_InvalidData ( 'Consumer type "' . $ type . '" is unknown' ) ; } return new $ classname ( $ user , $ definition , $ eventHandler ) ; }
Factory function. Creates a StreamConsumer-derived object for the given
type.

@param string $user         Use DataSift_User object.
@param string $type         Use the TYPE_ constants
@param mixed  $definition   CSDL string or a Definition object.
@param string $eventHandler The object that will receive events.

@return DataSift_StreamConsumer The consumer object
@throws DataSift_Exception_InvalidData
Factory function . Creates a StreamConsumer - derived object for the given type .