Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5

 Class JEventDispatcher

Description

Class to handle dispatching of events.

This is the Observable part of the Observer design pattern for the plugin architecture.

Located in /joomla/application/event.php (line 32)

Class JObject   (Subpackage Base)

Abstract class JObservable   (Subpackage Base)
   
   Class JEventDispatcher   (Subpackage Application)
Method Summary
Constructor JEventDispatcher __construct ()
Method void register (string $event, string $handler)
Method array trigger (string $event, [array $args = null], [boolean $doUnpublished = false])
Methods
Constructor __construct (line 39)

Constructor

  • access: protected
JEventDispatcher __construct ()

Redefinition of:
JObservable::__construct()
Constructor
getInstance (line 55)

Returns a reference to the global Event Dispatcher 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.5
  • access: public
JEventDispatcher &getInstance ()
register (line 75)

Registers an event handler to the event dispatcher

  • since: 1.5
  • 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 106)

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.5
  • 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: [DEPRECATED]

Inherited Methods

Inherited From JObservable

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

Inherited From JObject

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

Documentation generated on Mon, 05 Mar 2007 20:57:58 +0000 by phpDocumentor 1.3.1