public function ContainerAwareEventDispatcher::hasListeners

Overrides EventDispatcher::hasListeners

See also

EventDispatcherInterface::hasListeners

File

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

Class

ContainerAwareEventDispatcher
Lazily loads listeners and subscribers from the dependency injection container

Namespace

Symfony\Component\EventDispatcher

Code

public function hasListeners($eventName = null) {
  if (null === $eventName) {
    return (bool) count($this->listenerIds) || (bool) count($this->listeners);
  }
  if (isset($this->listenerIds[$eventName])) {
    return true;
  }
  return parent::hasListeners($eventName);
}