public function EventManager::dispatchEvent

Dispatches an event to all registered listeners.

Parameters

string $eventName The name of the event to dispatch. The name of the event is: the name of the method that is invoked on listeners.

EventArgs $eventArgs The event arguments to pass to the event handlers/listeners.: If not supplied, the single empty EventArgs instance is used.

Return value

boolean

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php, line 56

Class

EventManager
The EventManager is the central point of Doctrine's event listener system. Listeners are registered on the manager and events are dispatched through the manager.

Namespace

Doctrine\Common

Code

public function dispatchEvent($eventName, EventArgs $eventArgs = null) {
  if (isset($this->_listeners[$eventName])) {
    $eventArgs = $eventArgs === null ? EventArgs::getEmptyInstance() : $eventArgs;
    foreach ($this->_listeners[$eventName] as $listener) {
      $listener
        ->{$eventName}($eventArgs);
    }
  }
}