Class JEventDispatcher

Description

Class to handle dispatching events

Located in /application/event.php (line 23)

JObject
   |
   --JObservable
      |
      --JEventDispatcher
Direct descendents
Class Description
 class mosMambotHandler Legacy class, use JEventDispatcher instead
Method Summary
 JEventDispatcher __construct ()
 void register (string $event, string $handler)
 array trigger (string $event, [array $args = null], [boolean $doUnpublished = false])
Variables

Inherited Variables

Inherited from JObservable

JObservable::$_observers
JObservable::$_state
Methods
Constructor __construct (line 30)

Constructor

  • access: protected
JEventDispatcher __construct ()

Redefinition of:
JObservable::__construct()
Constructor

Redefined in descendants as:
getInstance (line 46)

Returns a reference to the global Language object, only creating it if it doesn't already exist.

This method must be invoked as:

  $dispatcher = &JEventDispatcher::getInstance();

  • return: The EventDispatcher object.
  • since: 1.1
  • access: public
JEventDispatcher &getInstance ()
register (line 72)

Registers an event handler to the event dispatcher

  • since: 1.1
  • access: public
void register (string $event, string $handler)
  • string $event: Name of the event to register handler for
  • string $handler: Name of the event handler
trigger (line 110)

Triggers an event by dispatching arguments to all observers that handle the event and returning their return values.

  • return: An array of results from each function call
  • since: 1.1
  • access: public
array trigger (string $event, [array $args = null], [boolean $doUnpublished = false])
  • string $event: The event name
  • array $args: An array of arguments
  • boolean $doUnpublished: [DEPRECEATED]

Inherited Methods

Inherited From JObservable

 JObservable::__construct()
 JObservable::attach()
 JObservable::detach()
 JObservable::getState()
 JObservable::notify()

Inherited From JObject

 JObject::__construct()
 JObject::JObject()
 JObject::get()
 JObject::set()
 JObject::toString()
 JObject::__destruct()

Documentation generated on Sat, 4 Feb 2006 14:23:22 +0100 by phpDocumentor 1.3.0RC4