Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

Observable Class Reference

Inheritance diagram for Observable:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 attach ($event, &$obj)
 attach_all (&$obj)
 dettach (&$obj)

Public Attributes

 $_observers = Array()

Protected Member Functions

 notify_all ($event, $msg)

Detailed Description

Methods to override: NONE This class implements the Observer design pattern defining Observable objects, when a class extends Observable Observers can be attached to the class listening for some event. When an event is detected in any method of the derived class the method can call notifyAll($event,$msg) to notify all the observers listening for event $event. The Observer objects must extend the Observer class and define the notify($event,$msg) method.

Definition at line 15 of file Observable.php.


Member Function Documentation

Observable::attach event,
&$  obj
 

This method can be used to attach an object to the class listening for some specific event. The object will be notified when the specified event is triggered by the derived class.

Definition at line 27 of file Observable.php.

Observable::attach_all &$  obj  ) 
 

Attaches an object to the class listening for any event. The object will be notified when any event occurs in the derived class.

Definition at line 40 of file Observable.php.

Observable::dettach &$  obj  ) 
 

Detaches an observer from the class.

Definition at line 52 of file Observable.php.

Observable::notify_all event,
msg
[protected]
 

Method used to notify objects of an event. This is called in the methods of the derived class that want to notify some event.

Definition at line 64 of file Observable.php.


The documentation for this class was generated from the following file:
Generated on Mon Jun 7 16:37:54 2004 for Galaxia by doxygen 1.3.4