You are here

public function EventManager::removeEventListener 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::removeEventListener()

Removes an event listener from the specified events.

Parameters

string|array $events:

object $listener:

Return value

void

1 call to EventManager::removeEventListener()
EventManager::removeEventSubscriber in 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

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

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]);
    }
  }
}