|
Erebot
latest
A modular IRC bot for PHP 5.3+
|
A class to handle numeric events. More...
Inheritance diagram for Erebot\NumericHandler:Public Member Functions | |
| __construct (\Erebot\CallableInterface $callback, $numeric) | |
| getCallback () | |
| getNumeric () | |
| handleNumeric (\Erebot\Interfaces\Event\Numeric $numeric) | |
| setCallback (\Erebot\CallableInterface $callback) | |
| setNumeric ($numeric) | |
Protected Attributes | |
| $callback | |
| Method/function to call when this handler is triggered. | |
| $numeric | |
| Numeric code handled by this instance. | |
A class to handle numeric events.
This class will call a given callback method/function whenever the bot receives a numeric event for the code this instance is meant to handle.
Definition at line 31 of file NumericHandler.php.
| Erebot\NumericHandler::__construct | ( | \Erebot\CallableInterface | $callback, |
| $numeric | |||
| ) |
Constructs a numeric event handler.
| Erebot::CallableInterface | $callback | A callback function/method which will be called whenever the bot receives a message with the given $numeric code. |
| int | Erebot::NumericReference | $numeric | The particular numeric code this numeric handler will react to, or a reference to it. |
Definition at line 50 of file NumericHandler.php.
| Erebot\NumericHandler::getCallback | ( | ) |
Returns the callback function/method associated with this handler.
| callback | The callback for this handler. |
Implements Erebot\Interfaces\NumericHandler.
Definition at line 73 of file NumericHandler.php.
| Erebot\NumericHandler::getNumeric | ( | ) |
Returns the numeric code associated with this handler.
| int|Erebot::NumericReference | The numeric code for this handler, or a reference to it. |
Implements Erebot\Interfaces\NumericHandler.
Definition at line 62 of file NumericHandler.php.
| Erebot\NumericHandler::handleNumeric | ( | \Erebot\Interfaces\Event\Numeric | $numeric | ) |
Given a numeric message, this methods tries to handle it.
| Erebot::Interfaces::Event::Numeric | $numeric | The numeric message to try to handle. |
Implements Erebot\Interfaces\NumericHandler.
Definition at line 78 of file NumericHandler.php.
| Erebot\NumericHandler::setCallback | ( | \Erebot\CallableInterface | $callback | ) |
Sets the callback function/method associated with this handler.
| Erebot::CallableInterface | $callback | New callable associated with this handler. |
Implements Erebot\Interfaces\NumericHandler.
Definition at line 67 of file NumericHandler.php.
| Erebot\NumericHandler::setNumeric | ( | $numeric | ) |
Sets the numeric code associated with this handler.
| int | Erebot::NumericReference | $numeric | New numeric code to assign to this handler, or a reference to it. |
Implements Erebot\Interfaces\NumericHandler.
Definition at line 56 of file NumericHandler.php.