You are here

public function ContainerAwareEventDispatcher::__construct in Zircon Profile 8

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

Constructs a container aware event dispatcher.

Parameters

\Symfony\Component\DependencyInjection\IntrospectableContainerInterface $container: The service container.

array $listeners: A nested array of listener definitions keyed by event name and priority. The array is expected to be ordered by priority. A listener definition is an associative array with one of the following key value pairs:

  • callable: A callable listener
  • service: An array of the form [service id, method]

A service entry will be resolved to a callable only just before its invocation.

File

core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php, line 85
Contains \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher.

Class

ContainerAwareEventDispatcher
A performance optimized container aware event dispatcher.

Namespace

Drupal\Component\EventDispatcher

Code

public function __construct(IntrospectableContainerInterface $container, array $listeners = []) {
  $this->container = $container;
  $this->listeners = $listeners;
  $this->unsorted = [];
}