Abstract Class JObservable

Description

Abstract observable class to implement the observer design pattern

Located in /common/base/observer.php (line 66)

JObject
   |
   --JObservable
Direct descendents
Class Description
 class JEventDispatcher Class to handle dispatching events
 class JEditor JEditor class to handle WYSIWYG editors
Variable Summary
 array $_observers
 mixed $_state
Method Summary
 JObservable __construct ()
 void attach (object $observer)
 boolean detach (object $observer)
 mixed getState ()
 array notify ()
Variables
array $_observers = array() (line 74)

An array of Observer objects to notify

  • access: private
mixed $_state = null (line 82)

The state of the observable object

  • access: private
Methods
Constructor __construct (line 88)

Constructor

JObservable __construct ()

Redefinition of:
JObject::__construct()
Class constructor, overridden in descendant classes.

Redefined in descendants as:
attach (line 126)

Attach an observer object

  • since: 1.1
  • access: public
void attach (object $observer)
  • object $observer: An observer object to attach
detach (line 138)

Detach an observer object

  • return: True if the observer object was detached
  • since: 1.1
  • access: public
boolean detach (object $observer)
  • object $observer: An observer object to detach
getState (line 99)

Get the state of the JObservable object

  • return: The state of the object
  • since: 1.1
  • access: public
mixed getState ()
notify (line 110)

Update each attached observer object and return an array of their return values

  • return: Array of return values from the observers
  • since: 1.1
  • access: public
array notify ()

Inherited Methods

Inherited From JObject

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

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