public function EventDispatcher::dispatch

@api

Overrides EventDispatcherInterface::dispatch

See also

EventDispatcherInterface::dispatch

1 call to EventDispatcher::dispatch()
ContainerAwareEventDispatcher::dispatch in drupal/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php
Lazily loads listeners for this event from the dependency injection container.
1 method overrides EventDispatcher::dispatch()
ContainerAwareEventDispatcher::dispatch in drupal/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php
Lazily loads listeners for this event from the dependency injection container.

File

drupal/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php, line 40

Class

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

Namespace

Symfony\Component\EventDispatcher

Code

public function dispatch($eventName, Event $event = null) {
  if (null === $event) {
    $event = new Event();
  }
  $event
    ->setDispatcher($this);
  $event
    ->setName($eventName);
  if (!isset($this->listeners[$eventName])) {
    return $event;
  }
  $this
    ->doDispatch($this
    ->getListeners($eventName), $eventName, $event);
  return $event;
}