Doctrine


Doctrine\Common\EventManager
/Doctrine/Common/EventManager.php at line 39

Class EventManager

EventManager

public 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.

License:
http://www.opensource.org/licenses/lgpl-license.php LGPL
See Also:
www.doctrine-project.org
Since:
2.0
Version:
$Revision: 3938 $
Author:
Guilherme Blanco
Jonathan Wage
Roman Borschel

Method Summary
void

addEventListener(string|array events, object listener)

Adds an event listener that listens on the specified events.

void

addEventSubscriber(Doctrine\Common\EventSubscriber subscriber)

Adds an EventSubscriber.

boolean

dispatchEvent(string eventName, EventArgs eventArgs)

Dispatches an event to all registered listeners.

array

getListeners(string event)

Gets the listeners of a specific event or all listeners.

boolean

hasListeners(string event)

Checks whether an event has any registered listeners.

void

removeEventListener(string|array events, object listener)

Removes an event listener from the specified events.

Method Detail

/Doctrine/Common/EventManager.php at line 97

addEventListener

public void addEventListener(string|array events, object listener)

Adds an event listener that listens on the specified events.

Parameters:
events - The event(s) to listen on.
listener - The listener object.

/Doctrine/Common/EventManager.php at line 134

addEventSubscriber

public void addEventSubscriber(Doctrine\Common\EventSubscriber subscriber)

Adds an EventSubscriber. The subscriber is asked for all the events he is interested in and added as a listener for these events.

Parameters:
subscriber - The subscriber.

/Doctrine/Common/EventManager.php at line 58

dispatchEvent

public boolean dispatchEvent(string eventName, EventArgs eventArgs)

Dispatches an event to all registered listeners.

Parameters:
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 - The event arguments to pass to the event handlers/listeners. If not supplied, the single empty EventArgs instance is used.

/Doctrine/Common/EventManager.php at line 75

getListeners

public array getListeners(string event)

Gets the listeners of a specific event or all listeners.

Parameters:
event - The name of the event.
Returns:
The event listeners for the specified event, or all event listeners.

/Doctrine/Common/EventManager.php at line 86

hasListeners

public boolean hasListeners(string event)

Checks whether an event has any registered listeners.

Returns:
TRUE if the specified event has any listeners, FALSE otherwise.

/Doctrine/Common/EventManager.php at line 115

removeEventListener

public void removeEventListener(string|array events, object listener)

Removes an event listener from the specified events.


Doctrine