Dispatches an event to all registered listeners.
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.
boolean
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);
}
}
}