Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher
Lazily loads listeners and subscribers from the dependency injection container
- Author: Fabien Potencier <fabien@symfony.com>
Synopsis
class ContainerAwareEventDispatcher
extends EventDispatcher
{
- // members
- private ContainerInterface $container;
- private array $listenerIds;
- private array $listeners;
- // methods
- public void __construct()
- public void addListenerService()
- public void removeListener()
- public void hasListeners()
- public void getListeners()
- public void addSubscriberService()
- public void dispatch()
- public void getContainer()
- protected void lazyLoad()
- // Inherited methods from EventDispatcher
- public void dispatch()
- public void getListeners()
- public void hasListeners()
- public void addListener()
- public void removeListener()
- public void addSubscriber()
- public void removeSubscriber()
- protected void doDispatch()
Hierarchy
Members
private
- $container
—
Symfony\Component\DependencyInjection\ContainerInterface
The container from where services are loaded - $listenerIds
—
array
The service IDs of the event listeners and subscribers - $listeners
—
array
The services registered as listeners
Methods
protected
- lazyLoad() — Lazily loads listeners for this event from the dependency injection container.
public
- __construct() — Constructor.
- addListenerService() — Adds a service as event listener
- addSubscriberService() — Adds a service as event subscriber
- dispatch() — {@inheritDoc}
- getContainer()
- getListeners()
- hasListeners()
- removeListener()
Inherited from Symfony\Component\EventDispatcher\EventDispatcher
protected
- doDispatch() — Triggers the listeners of an event.