PHP Class Symfony\Bundle\FrameworkBundle\ContainerAwareEventDispatcher

Author: Fabien Potencier ([email protected])
Author: Bernhard Schussek ([email protected])
Inheritance: extends Symfony\Component\EventDispatcher\EventDispatcher
Datei anzeigen Open project: pmjones/php-framework-benchmarks Class Usage Examples

Public Methods

Method Description
__construct ( Symfony\Component\DependencyInjection\ContainerInterface $container ) Constructor.
addListenerService ( string $eventName, array $callback, integer $priority ) Adds a service as event listener
dispatch ( $eventName, Symfony\Component\EventDispatcher\Event $event = null ) {@inheritDoc}

Method Details

__construct() public method

Constructor.
public __construct ( Symfony\Component\DependencyInjection\ContainerInterface $container )
$container Symfony\Component\DependencyInjection\ContainerInterface A ContainerInterface instance

addListenerService() public method

Adds a service as event listener
public addListenerService ( string $eventName, array $callback, integer $priority )
$eventName string Event for which the listener is added
$callback array The service ID of the listener service & the method name that has to be called
$priority integer The higher this value, the earlier an event listener will be triggered in the chain. Defaults to 0.

dispatch() public method

Lazily loads listeners for this event from the dependency injection container.
public dispatch ( $eventName, Symfony\Component\EventDispatcher\Event $event = null )
$event Symfony\Component\EventDispatcher\Event