You are here

public function EventManager::addEventSubscriber in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/common/lib/Doctrine/Common/EventManager.php \Doctrine\Common\EventManager::addEventSubscriber()

Adds an EventSubscriber. The subscriber is asked for all the events it is interested in and added as a listener for these events.

Parameters

\Doctrine\Common\EventSubscriber $subscriber The subscriber.:

Return value

void

File

vendor/doctrine/common/lib/Doctrine/Common/EventManager.php, line 137

Class

EventManager
The EventManager is the central point of Doctrine's event listener system. Listeners are registered on the manager and events are dispatched through the manager.

Namespace

Doctrine\Common

Code

public function addEventSubscriber(EventSubscriber $subscriber) {
  $this
    ->addEventListener($subscriber
    ->getSubscribedEvents(), $subscriber);
}