Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

License

Content on this site is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5. Some parts of this website may be subject to other licenses.

 Class JDispatcher

Description

Class to handle dispatching of events.

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

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

Class JObject   (Subpackage Base)

Abstract class JObservable   (Subpackage Base)
   
   Class JDispatcher   (Subpackage Event)
Method Summary
Constructor JDispatcher __construct ()
Method void register (string $event, string $handler)
Method array trigger (string $event, [array $args = null], [boolean $doUnpublished = false])
Variables

Inherited Variables

Inherited from JObject

Variable JObject::$_errors
Methods
Constructor __construct (line 39)

Constructor

  • access: protected
JDispatcher __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 = &JDispatcher::getInstance();

  • return: The EventDispatcher object.
  • since: 1.5
  • access: public
JDispatcher &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::getError()
 JObject::getErrors()
 JObject::getProperties()
 JObject::getPublicProperties()
 JObject::set()
 JObject::setError()
 JObject::setProperties()
 JObject::toString()

Documentation generated on Tue, 29 Jan 2008 18:45:25 +0000 by phpDocumentor 1.3.1