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. |
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.
updated 6/17/07
5/4/07
SEventHandler::getPermission | ( | ) |
Get the permission object associated with this event handler.
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.
$e | [SEvent]: The event |
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.
$p | [SPermission]: A permission object (a subclass of SPermission) |