You are here

public function ContainerAwareEventDispatcher::getListeners in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php \Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher::getListeners()
  2. 8 core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::getListeners()
Same name and namespace in other branches
  1. 8.0 vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php \Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher::getListeners()

Gets the listeners of a specific event or all listeners sorted by descending priority.

Parameters

string $eventName The name of the event:

Return value

array The event listeners for the specified event, or all event listeners by event name

Overrides EventDispatcher::getListeners

File

vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php, line 121

Class

ContainerAwareEventDispatcher
Lazily loads listeners and subscribers from the dependency injection container.

Namespace

Symfony\Component\EventDispatcher

Code

public function getListeners($eventName = null) {
  if (null === $eventName) {
    foreach ($this->listenerIds as $serviceEventName => $args) {
      $this
        ->lazyLoad($serviceEventName);
    }
  }
  else {
    $this
      ->lazyLoad($eventName);
  }
  return parent::getListeners($eventName);
}