|
Erebot
latest
A modular IRC bot for PHP 5.3+
|
Interface for event handlers. More...
Inheritance diagram for Erebot\Interfaces\EventHandler:Public Member Functions | |
| getCallback () | |
| getFilter () | |
| handleEvent (\Erebot\Interfaces\Event\Base\Generic $event) | |
| setCallback (\Erebot\CallableInterface $callback) | |
| setFilter (\Erebot\Interfaces\Event\Match $filter=null) | |
Interface for event handlers.
This interface provides the necessary methods to represent a structure capable of handling events from an IRC server.
Definition at line 30 of file EventHandler.php.
| Erebot\Interfaces\EventHandler::getCallback | ( | ) |
Returns a reference to the callback which was associated with this handler during construction.
| callback | The callback associated with this handler. |
Implemented in Erebot\EventHandler.
| Erebot\Interfaces\EventHandler::getFilter | ( | ) |
Returns the filter currently associated with this event handler.
| Erebot::Interfaces::Event::Match | The current filter associated with this event handler, or NULL if no filter has been set yet. |
Implemented in Erebot\EventHandler.
| Erebot\Interfaces\EventHandler::handleEvent | ( | \Erebot\Interfaces\Event\Base\Generic | $event | ) |
Given an event, this method does its best to handler it.
| Erebot::Interfaces::Event::Base::Generic | $event | An event to try to handle. |
Implemented in Erebot\EventHandler.
| Erebot\Interfaces\EventHandler::setCallback | ( | \Erebot\CallableInterface | $callback | ) |
Sets the callback associated with this handler.
| Erebot::CallableInterface | $callback | This callable object will be called whenever an event is received that matches the criteria set by this event handler's filter. |
Implemented in Erebot\EventHandler.
| Erebot\Interfaces\EventHandler::setFilter | ( | \Erebot\Interfaces\Event\Match | $filter = null | ) |
Sets the filter associated with this event handler.
| Erebot::Interfaces::Event::Match | $filter | (optional) The new filter associated with this event handler. Its criterion must sucessfully match the contents of an event for that event to trigger this event handler's callback. |
Implemented in Erebot\EventHandler.