8.5.x EventDispatcher.php EventDispatcher::hasListeners($eventName = null)
8.0.x EventDispatcher.php EventDispatcher::hasListeners($eventName = null)
8.1.x EventDispatcher.php EventDispatcher::hasListeners($eventName = null)
8.2.x EventDispatcher.php EventDispatcher::hasListeners($eventName = null)
8.3.x EventDispatcher.php EventDispatcher::hasListeners($eventName = null)
8.4.x EventDispatcher.php EventDispatcher::hasListeners($eventName = null)
8.6.x EventDispatcher.php EventDispatcher::hasListeners($eventName = null)

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

1 call to EventDispatcher::hasListeners()
ContainerAwareEventDispatcher::hasListeners in vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php
Checks whether an event has any registered listeners.
1 method overrides EventDispatcher::hasListeners()
ContainerAwareEventDispatcher::hasListeners in vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php
Checks whether an event has any registered listeners.

File

vendor/symfony/event-dispatcher/EventDispatcher.php, line 104

Class

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

Namespace

Symfony\Component\EventDispatcher

Code

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