lib/config/sfEventDispatcherRetriever.class.php
public static function retrieve($context)
    {
        if ($context instanceof sfContext || $context instanceof sfProjectConfiguration) {
            return $context->getEventDispatcher();
        } elseif (isset($GLOBALS['dispatcher'])) {
            return $GLOBALS['dispatcher'];
        }

        $refClass = new ReflectionClass(get_class($context));

        if ($refClass->hasProperty('dispatcher')) {
            return self::retrieveByDispatcherProperty($refClass, $context);
        } elseif ($refClass->hasProperty('configuration')) {
            return self::retrieveByConfigurationProperty($refClass, $context);
        }
    }
public static function retrieve($context)
    {
        if ($context instanceof sfContext || $context instanceof sfProjectConfiguration) {
            return $context->getEventDispatcher();
        } elseif (isset($GLOBALS['dispatcher'])) {
            return $GLOBALS['dispatcher'];
        }

        $refClass = new ReflectionClass(get_class($context));

        if ($refClass->hasProperty('dispatcher')) {
            return self::retrieveByDispatcherProperty($refClass, $context);
        } elseif ($refClass->hasProperty('configuration')) {
            return self::retrieveByConfigurationProperty($refClass, $context);
        }
    }
public static function retrieve ( $ context ) { if ( $ context instanceof sfContext || $ context instanceof sfProjectConfiguration ) { return $ context -> getEventDispatcher ( ) ; } elseif ( isset ( $ GLOBALS [ 'dispatcher' ] ) ) { return $ GLOBALS [ 'dispatcher' ] ; } $ refClass = new ReflectionClass ( get_class ( $ context ) ) ; if ( $ refClass -> hasProperty ( 'dispatcher' ) ) { return self :: retrieveByDispatcherProperty ( $ refClass , $ context ) ; } elseif ( $ refClass -> hasProperty ( 'configuration' ) ) { return self :: retrieveByConfigurationProperty ( $ refClass , $ context ) ; } }
Returns the sfEventDispatcher instance.

@param mixed $context

@return sfEventDispatcher|null
Returns the sfEventDispatcher instance .