interface EventSubscriberInterface

An EventSubscriber knows himself what events he is interested in. If an EventSubscriber is added to an EventDispatcherInterface, the manager invokes {@link getSubscribedEvents} and registers the subscriber as a listener for all returned events.

@author Guilherme Blanco <guilhermeblanco@hotmail.com> @author Jonathan Wage <jonwage@gmail.com> @author Roman Borschel <roman@code-factory.org> @author Bernhard Schussek <bschussek@gmail.com>

@api

Hierarchy

Expanded class hierarchy of EventSubscriberInterface

All classes that implement EventSubscriberInterface

55 files declare their use of EventSubscriberInterface
AbstractHasDispatcher.php in drupal/core/vendor/guzzle/common/Guzzle/Common/AbstractHasDispatcher.php
AccessSubscriber.php in drupal/core/lib/Drupal/Core/EventSubscriber/AccessSubscriber.php
Contains Drupal\Core\EventSubscriber\AccessSubscriber.
AjaxSubscriber.php in drupal/core/lib/Drupal/Core/Ajax/AjaxSubscriber.php
Contains \Drupal\Core\Ajax\AjaxSubscriber.
BanSubscriber.php in drupal/core/modules/ban/lib/Drupal/ban/EventSubscriber/BanSubscriber.php
Definition of Drupal\ban\EventSubscriber\BanSubscriber.
ConfigGlobalOverrideSubscriber.php in drupal/core/lib/Drupal/Core/EventSubscriber/ConfigGlobalOverrideSubscriber.php
Contains \Drupal\Core\EventSubscriber\ConfigGlobalOverrideSubscriber.

... See full list

File

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

Namespace

Symfony\Component\EventDispatcher
View source
interface EventSubscriberInterface {

  /**
   * Returns an array of event names this subscriber wants to listen to.
   *
   * The array keys are event names and the value can be:
   *
   *  * The method name to call (priority defaults to 0)
   *  * An array composed of the method name to call and the priority
   *  * An array of arrays composed of the method names to call and respective
   *    priorities, or 0 if unset
   *
   * For instance:
   *
   *  * array('eventName' => 'methodName')
   *  * array('eventName' => array('methodName', $priority))
   *  * array('eventName' => array(array('methodName1', $priority), array('methodName2'))
   *
   * @return array The event names to listen to
   *
   * @api
   */
  public static function getSubscribedEvents();

}

Members

Namesort descending Modifiers Type Description Overrides
EventSubscriberInterface::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. 52