Erebot  latest
A modular IRC bot for PHP 5.3+
Erebot\Event\Match\Chan Class Reference

A filter that compares the target channel for an event with some predefined value. More...

+ Inheritance diagram for Erebot\Event\Match\Chan:

Public Member Functions

 __construct ($chan)
 
 getChan ()
 
 match (\Erebot\Interfaces\Event\Base\Generic $event)
 
 setChan ($chan)
 

Protected Attributes

 $chan
 Channel to use in the comparison, as a string.
 

Detailed Description

A filter that compares the target channel for an event with some predefined value.

Note
Events that do not relate to a channel never match.

Definition at line 31 of file Chan.php.

Constructor & Destructor Documentation

Erebot\Event\Match\Chan::__construct (   $chan)

Creates a new instance of the filter.

Parameters
$chanstring|object Channel to match incoming events against.
Exceptions
Erebot::InvalidValueExceptionThe given chan is invalid.

Definition at line 45 of file Chan.php.

References Erebot\Event\Match\Chan\$chan, and Erebot\Event\Match\Chan\setChan().

Member Function Documentation

Erebot\Event\Match\Chan::getChan ( )

Returns the channel associated with this filter.

Return values
stringChannel associated with this filter.

Definition at line 56 of file Chan.php.

References Erebot\Event\Match\Chan\$chan.

Erebot\Event\Match\Chan::match ( \Erebot\Interfaces\Event\Base\Generic  $event)

Decides whether the given event passes the filter or not.

Parameters
$eventAn event to try to match to the criterion expressed by this filter.
Return values
booltrue if the event matches the criterion, false otherwise.

Implements Erebot\Interfaces\Event\Match.

Definition at line 79 of file Chan.php.

Erebot\Event\Match\Chan::setChan (   $chan)

Sets the channel used in comparisons.

Parameters
$chanstring|object Channel to match incoming events against.
Exceptions
Erebot::InvalidValueExceptionThe given chan is invalid.

Definition at line 70 of file Chan.php.

References Erebot\Event\Match\Chan\$chan, and Erebot\Utils\stringifiable().

Referenced by Erebot\Event\Match\Chan\__construct().


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