EventMaster Class Reference

List of all members.

Public Member Functions

 __construct ()
 exist ($name)
 attach ($name, $method)
 detach ($name)
 trigger ($name, $data)

Private Attributes

 $events
 hash of event handlers


Detailed Description

Class which allows to assign|fire events.

Constructor & Destructor Documentation

__construct (  ) 

constructor


Member Function Documentation

attach ( name,
method 
)

Attach custom code to event.

Only on event handler can be attached in the same time. If new event handler attached - old will be detached.

Parameters:
name name of event, case non-sensitive
method function which will be attached. You can use array(class, method) if you want to attach the method of the class.

detach ( name  ) 

Detach code from event

Parameters:
name name of event, case non-sensitive

exist ( name  ) 

Method check if event with such name already exists.

Parameters:
name name of event, case non-sensitive
Returns:
true if event with such name registered, false otherwise

trigger ( name,
data 
)

Trigger event.

Parameters:
name name of event, case non-sensitive
data value which will be provided as argument for event function, you can provide multiple data arguments, method accepts variable number of parameters
Returns:
true if event handler was not assigned , result of event hangler otherwise


Member Data Documentation

$events [private]

hash of event handlers


The documentation for this class was generated from the following file:

Generated on Tue Mar 3 20:06:24 2009 for dhxmlXConnector by  doxygen 1.5.8