You are here

public function EventDispatcher::hasListeners in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/event-dispatcher/EventDispatcher.php \Symfony\Component\EventDispatcher\EventDispatcher::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

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 81

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