SEventHandler Class Reference
[Event Handling]

Handle SEvent objects. More...

Inheritance diagram for SEventHandler:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 doc ()
 Return a documentation string about this class.
 getPermission ()
 Get the permission object associated with this event handler.
 handleEvent ($e)
 Handle an SEvent.
 setPermission ($p)
 Set the permission object to use for this event handler.


Detailed Description

Handle SEvent objects.

This is the basic class for handling SEvent objects, which encode user-generated events. Project event handlers should extend this class to handle events specific to their project.

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

updated 6/17/07

5/4/07


Member Function Documentation

SEventHandler::getPermission (  ) 

Get the permission object associated with this event handler.

Returns:
[SPermission]: This handler's permission object

SEventHandler::handleEvent ( e  ) 

Handle an SEvent.

Handle a user-generated event represented by an SEvent object. Check to see if the user who is the source of the event has permission to perform the event. If not, throw an error. If so, continue.

No actual error handling takes place in this class. When you extend this class in your project, extend this function as well. Call parent::handleEvent($e). If it returns true, process the actual event. If not, return false.

Parameters:
$e [SEvent]: The event
Returns:
[bool]: True on success, false on failure

SEventHandler::setPermission ( p  ) 

Set the permission object to use for this event handler.

This permission object will be used to check permissions when handleEvent() is called. Before you start handling events using a subclass of this class, call setPermission() on the subclass and pass in your subclass of SPermission. That way, you will be checking your project events against your project permissions.

Parameters:
$p [SPermission]: A permission object (a subclass of SPermission)


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

Generated on Wed Nov 24 02:03:00 2010 for Common by  doxygen 1.5.6