A base object which is event-aware, i.e. it knows how to create, register, and fire events. It also has contains other general-purpose methods, such as simple XML serialization.
public function createEvent( |
| ) |
Creates an event for the current class.
name | The name of the event. |
True on success, false on failure.
public function hasEvent( |
| ) |
Determine whether the given event exists.
name | The name of the event. |
True on success, false on failure.
public function hasHandlers( |
| ) |
Determine if thereare any handlers for the given event.
name | The name of the event. |
True on success, false on failure.
public function raiseEvent( |
| ) |
Raises the given event name for this class.
name | The name of the event. |
params | Any number of additional parameters may be passed to this method. |
True on success, false on failure.
public function registerEventHandler( |
| ) |
Registers a handler for an event of this class.
type | The class of the class that raises the event. |
name | The name of the event. |
func | The name of the function that will handle this event. |
True on success, false on failure.
public function registerStaticEventHandler( |
| ) |
Registers a static handler for an event of this class. Use this if your handler belongs to a class but does not require an instance of it in order to work.
type | The class of the class that raises the event. |
name | The name of the event. |
func | The name of the function that will handle this event. |
True on success, false on failure.
Performs a simple XML serialization of the object. If the object has an exclude_fields which is an array, then the method will NOT include that property in the serialization. In addition, it will not include any properties whose name matches an item in the exclude_fields array.
A string containing an XML representation of the object.
public function deserializeXML( |
| ) |
Populates the object's properties from a string of XML data.
xmldata | The XML containing a serialized representation of the object. This is typically the string generated by serializeXML and can be either a string of data or a path to the data file. |