class ContainerAwareEventDispatcher extends EventDispatcher
Lazily loads listeners and subscribers from the dependency injection container
Methods
|
dispatch(string $eventName, Event $event = null)
Dispatches an event to all registered listeners. |
||
| array |
getListeners(string $eventName = null)
Gets the listeners of a specific event or all listeners. |
|
| Boolean |
hasListeners(string $eventName = null)
Checks whether an event has any registered listeners. |
|
|
addListener(string $eventName, callable $listener, integer $priority)
Adds an event listener that listens on the specified events. |
from EventDispatcher | |
|
removeListener(string|array $eventName, callable $listener)
Removes an event listener from the specified events. |
||
|
addSubscriber(EventSubscriberInterface $subscriber)
Adds an event subscriber. |
from EventDispatcher | |
|
removeSubscriber(EventSubscriberInterface $subscriber)
Removes an event subscriber. |
from EventDispatcher | |
|
__construct(ContainerInterface $container)
Constructor. |
||
|
addListenerService(string $eventName, array $callback, integer $priority)
Adds a service as event listener |
Details
at line 141
public
dispatch(string $eventName, Event $event = null)
Dispatches an event to all registered listeners.
at line 120
public array
getListeners(string $eventName = null)
Gets the listeners of a specific event or all listeners.
at line 104
public Boolean
hasListeners(string $eventName = null)
Checks whether an event has any registered listeners.
in EventDispatcher at line 87
public
addListener(string $eventName, callable $listener, integer $priority)
Adds an event listener that listens on the specified events.
at line 74
public
removeListener(string|array $eventName, callable $listener)
Removes an event listener from the specified events.
in EventDispatcher at line 114
public
addSubscriber(EventSubscriberInterface $subscriber)
Adds an event subscriber.
The subscriber is asked for all the events he is
interested in and added as a listener for these events.
in EventDispatcher at line 128
public
removeSubscriber(EventSubscriberInterface $subscriber)
Removes an event subscriber.
at line 50
public
__construct(ContainerInterface $container)
Constructor.
at line 65
public
addListenerService(string $eventName, array $callback, integer $priority)
Adds a service as event listener