class ContainerAwareEventManager extends EventManager
Allows lazy loading of listener services.
__construct(ContainerInterface $container) | ||
bool | dispatchEvent(string $eventName, EventArgs $eventArgs = null) Dispatches an event to all registered listeners. | |
array | getListeners(string $event = null) Gets the listeners of a specific event or all listeners. | |
bool | hasListeners(string $event) Checks whether an event has any registered listeners. | |
addEventListener(string|array $events, object|string $listener) Adds an event listener that listens on the specified events. | ||
removeEventListener(string|array $events, object|string $listener) Removes an event listener from the specified events. |
ContainerInterface | $container |
Dispatches an event to all registered listeners.
string | $eventName | The name of the event to dispatch. The name of the event is the name of the method that is invoked on listeners. |
EventArgs | $eventArgs | The event arguments to pass to the event handlers/listeners. If not supplied, the single empty EventArgs instance is used. |
bool |
Gets the listeners of a specific event or all listeners.
string | $event | The name of the event |
array | The event listeners for the specified event, or all event listeners |
Checks whether an event has any registered listeners.
string | $event |
bool | TRUE if the specified event has any listeners, FALSE otherwise |
Adds an event listener that listens on the specified events.
string|array | $events | The event(s) to listen on |
object|string | $listener | The listener object |
RuntimeException |
Removes an event listener from the specified events.
string|array | $events | |
object|string | $listener |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Bridge/Doctrine/ContainerAwareEventManager.html