Erebot  latest
A modular IRC bot for PHP 5.3+
Erebot\Interfaces\EventDispatcher Interface Reference

Interface for a class that can dispatch events to event handlers. More...

+ Inheritance diagram for Erebot\Interfaces\EventDispatcher:

Public Member Functions

 addEventHandler (\Erebot\Interfaces\EventHandler $handler)
 
 addNumericHandler (\Erebot\Interfaces\NumericHandler $handler)
 
 dispatch (\Erebot\Interfaces\Event\Base\Generic $event)
 
 removeEventHandler (\Erebot\Interfaces\EventHandler $handler)
 
 removeNumericHandler (\Erebot\Interfaces\NumericHandler $handler)
 

Detailed Description

Interface for a class that can dispatch events to event handlers.

Definition at line 28 of file EventDispatcher.php.

Member Function Documentation

Erebot\Interfaces\EventDispatcher::addEventHandler ( \Erebot\Interfaces\EventHandler  $handler)

Registers an event handler on this connection.

Parameters
Erebot::Interfaces::EventHandler$handlerThe handler to register.
Erebot\Interfaces\EventDispatcher::addNumericHandler ( \Erebot\Interfaces\NumericHandler  $handler)

Registers a numeric handler on this connection.

Parameters
Erebot::Interfaces::NumericHandler$handlerThe handler to register.
Erebot\Interfaces\EventDispatcher::dispatch ( \Erebot\Interfaces\Event\Base\Generic  $event)

Dispatches the given event to handlers which have been registered for this type of event.

Parameters
Erebot::Interfaces::Event::Base::Generic$eventAn event to dispatch.
Note
For the purposes of this method, numeric messages (objects implementing the Erebot::Interfaces::Event::Numeric interface) are considered "events" too.

Implemented in Erebot\IrcConnection.

Erebot\Interfaces\EventDispatcher::removeEventHandler ( \Erebot\Interfaces\EventHandler  $handler)

Unregisters an event handler on this connection.

Parameters
Erebot::Interfaces::EventHandler$handlerThe handler to unregister.
Exceptions
Erebot::NotFoundExceptionThrown when the given handler could not be found, such as when it was not registered on this connection.
Erebot\Interfaces\EventDispatcher::removeNumericHandler ( \Erebot\Interfaces\NumericHandler  $handler)

Unregisters a numeric handler on this connection.

Parameters
Erebot::Interfaces::NumericHandler$handlerThe handler to unregister.
Exceptions
Erebot::NotFoundExceptionThrown when the given handler could not be found, such as when it was not registered on this connection.

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