SPOSTEventHandler Class Reference
[Event Handling]

Create and handle SEvent object(s) from user POST data. More...

Inheritance diagram for SPOSTEventHandler:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 doc ()
 Return a documentation string about this class.
 getSWAT ()
 Get the global SWAT object.
 handleEvents ()
 Create and handle events implicit in the POST data.
 setEventHandler ($eh)
 Set the event handler to be used with this object.
 setSWAT ($swat)
 Set our link to the SWAT object.

Protected Member Functions

 callEventHandler ($e)
 Call this class' event handler on the passed event.
 generateEvent ()
 Generate an SEvent object from the POST data.
 generateEventHandler ()
 Get the event handler to be used for this object.

Protected Attributes

 $eventHandler
 The event handler to be used to handle POST events.
 $swat
 A link to the global SWAT object.


Detailed Description

Create and handle SEvent object(s) from user POST data.

Create SEvent object(s) from the user's POST data. Then call on an event handler (either a custom event handler that has been set on the object, or a new instance of SEventHandler) to handle the event objects.

Author:
Jonathan Stuart-Moore <jwsm@shodor.org> (2007)
Date:
updated 11/28/07

updated 7/2/07

Definition at line 14 of file SPOSTEventHandler.php5.


Member Function Documentation

SPOSTEventHandler::callEventHandler ( e  )  [protected]

Call this class' event handler on the passed event.

For internal use only.

Get the proper event handler for this class by calling generateEventHandler(). Call the event handler's handleEvent() function on the event. If there are errors, return false. Otherwise, return true.

Parameters:
$e [SEvent]: The event to be handled
Returns:
[bool]: True if the event was handled without errors, false if there were errors

Definition at line 130 of file SPOSTEventHandler.php5.

References generateEventHandler(), SObject::getErrorFrom(), SObject::hasError(), and SObject::setPrettyError().

Referenced by handleEvents().

SPOSTEventHandler::generateEvent (  )  [protected]

Generate an SEvent object from the POST data.

For internal use only.

Check to make sure all components required to build a valid SEvent are present in the POST array. If they are, create and return an SEvent object. If not, return false.

Returns:
[mixed]: The SEvent object, or false if there is an error

Definition at line 77 of file SPOSTEventHandler.php5.

References getSWAT(), and SObject::setPrettyError().

Referenced by handleEvents().

SPOSTEventHandler::generateEventHandler (  )  [protected]

Get the event handler to be used for this object.

For internal use only.

If there is an eventHandler stored on this object, return that. Otherwise, create and return a new SEventHandler object.

Returns:
[SEventHandler]: an instance of SEventHandler or a subclass of SEventHandler

Definition at line 51 of file SPOSTEventHandler.php5.

References setEventHandler().

Referenced by callEventHandler().

SPOSTEventHandler::getSWAT (  ) 

Get the global SWAT object.

Returns:
[SWAT]: The global SWAT object

Definition at line 39 of file SPOSTEventHandler.php5.

Referenced by generateEvent(), and handleEvents().

SPOSTEventHandler::handleEvents (  ) 

Create and handle events implicit in the POST data.

Do the POST event handling! This function first generates an event object(s) from the POST input, then calls the class event handler on the event(s) using the callEventHandler() function.

Returns:
[bool]: True if all events were handled without error, false if there were errors

Definition at line 157 of file SPOSTEventHandler.php5.

References callEventHandler(), generateEvent(), SObject::getErrorFrom(), getSWAT(), SObject::hasError(), and SObject::setPrettyWarning().

SPOSTEventHandler::setEventHandler ( eh  ) 

Set the event handler to be used with this object.

Store an instance or subclass instance of SEventHandler to be used to handle POST events generated by this class when handleEvents() is called.

Parameters:
$eh [SEventHandler]: An instance or subclass instance of SEventHandler

Definition at line 65 of file SPOSTEventHandler.php5.

Referenced by generateEventHandler().

SPOSTEventHandler::setSWAT ( swat  ) 

Set our link to the SWAT object.

Parameters:
$swat [SWAT]: The global SWAT object

Definition at line 30 of file SPOSTEventHandler.php5.

References $swat.


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

Generated on Wed Nov 24 02:06:34 2010 for Common by  doxygen 1.5.6