public function EventManager::removeEventListener

Removes an event listener from the specified events.

Parameters

string|array $events:

object $listener:

1 call to EventManager::removeEventListener()
EventManager::removeEventSubscriber in drupal/core/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php
Removes an EventSubscriber. The subscriber is asked for all the events it is interested in and removed as a listener for these events.

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php, line 113

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 removeEventListener($events, $listener) {

  // Picks the hash code related to that listener
  $hash = spl_object_hash($listener);
  foreach ((array) $events as $event) {

    // Check if actually have this listener associated
    if (isset($this->_listeners[$event][$hash])) {
      unset($this->_listeners[$event][$hash]);
    }
  }
}