
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. | |
Private Attributes | |
| $permission | |
| The permission object used to check whether a user can perform a given event. | |
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
Definition at line 14 of file SEventHandler.php5.
| SEventHandler::getPermission | ( | ) |
Get the permission object associated with this event handler.
Definition at line 81 of file SEventHandler.php5.
Referenced by handleEvent().
| 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 |
Definition at line 37 of file SEventHandler.php5.
References getPermission(), and SObject::setPrettyWarning().
| 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) |
Definition at line 72 of file SEventHandler.php5.
1.5.6