public function EventDispatcher::removeListener

Overrides EventDispatcherInterface::removeListener

See also

EventDispatcherInterface::removeListener

3 calls to EventDispatcher::removeListener()
ContainerAwareEventDispatcher::lazyLoad in drupal/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php
Lazily loads listeners for this event from the dependency injection container.
ContainerAwareEventDispatcher::removeListener in drupal/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php
Removes an event listener from the specified events.
EventDispatcher::removeSubscriber in drupal/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php
1 method overrides EventDispatcher::removeListener()
ContainerAwareEventDispatcher::removeListener in drupal/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php
Removes an event listener from the specified events.

File

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

Class

EventDispatcher
The EventDispatcherInterface is the central point of Symfony's event listener system.

Namespace

Symfony\Component\EventDispatcher

Code

public function removeListener($eventName, $listener) {
  if (!isset($this->listeners[$eventName])) {
    return;
  }
  foreach ($this->listeners[$eventName] as $priority => $listeners) {
    if (false !== ($key = array_search($listener, $listeners, true))) {
      unset($this->listeners[$eventName][$priority][$key], $this->sorted[$eventName]);
    }
  }
}