8.5.x EventDispatcher.php EventDispatcher::doDispatch($listeners, $eventName, Event $event)
8.0.x EventDispatcher.php EventDispatcher::doDispatch($listeners, $eventName, Event $event)
8.1.x EventDispatcher.php EventDispatcher::doDispatch($listeners, $eventName, Event $event)
8.2.x EventDispatcher.php EventDispatcher::doDispatch($listeners, $eventName, Event $event)
8.3.x EventDispatcher.php EventDispatcher::doDispatch($listeners, $eventName, Event $event)
8.4.x EventDispatcher.php EventDispatcher::doDispatch($listeners, $eventName, Event $event)
8.6.x EventDispatcher.php EventDispatcher::doDispatch($listeners, $eventName, Event $event)

Triggers the listeners of an event.

This method can be overridden to add functionality that is executed for each listener.

Parameters

callable[] $listeners The event listeners:

string $eventName The name of the event to dispatch:

Event $event The event object to pass to the event handlers/listeners:

1 call to EventDispatcher::doDispatch()
EventDispatcher::dispatch in vendor/symfony/event-dispatcher/EventDispatcher.php
Dispatches an event to all registered listeners.

File

vendor/symfony/event-dispatcher/EventDispatcher.php, line 178

Class

EventDispatcher
The EventDispatcherInterface is the central point of Symfony's event listener system.

Namespace

Symfony\Component\EventDispatcher

Code

protected function doDispatch($listeners, $eventName, Event $event) {
  foreach ($listeners as $listener) {
    if ($event
      ->isPropagationStopped()) {
      break;
    }
    call_user_func($listener, $event, $eventName, $this);
  }
}