You are here

public function ContainerAwareEventDispatcher::hasListeners in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php \Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher::hasListeners()
  2. 8 core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::hasListeners()
Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::hasListeners()

Checks whether an event has any registered listeners.

Parameters

string $eventName The name of the event:

Return value

bool true if the specified event has any listeners, false otherwise

Overrides EventDispatcherInterface::hasListeners

File

core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php, line 167
Contains \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher.

Class

ContainerAwareEventDispatcher
A performance optimized container aware event dispatcher.

Namespace

Drupal\Component\EventDispatcher

Code

public function hasListeners($event_name = NULL) {
  return (bool) count($this
    ->getListeners($event_name));
}