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

A class representing a numeric event. More...

+ Inheritance diagram for Erebot\Event\Numeric:

Public Member Functions

 __construct (\Erebot\Interfaces\Connection $connection, $numeric, $source, $target, $text)
 
 __destruct ()
 Destructor.
 
 getCode ()
 
 getConnection ()
 
 getSource ()
 
 getTarget ()
 
 getText ()
 
 preventDefault ($prevent=null)
 

Protected Attributes

 $connection
 The connection object this numeric event came from.
 
 $halt
 Whether the default action should be prevented or not.
 
 $numeric
 Numeric code.
 
 $source
 Source of the numeric event.
 
 $target
 Target of the numeric event; this is usually the bot.
 
 $text
 Content of the numeric event.
 

Detailed Description

A class representing a numeric event.

Definition at line 27 of file Numeric.php.

Constructor & Destructor Documentation

Erebot\Event\Numeric::__construct ( \Erebot\Interfaces\Connection  $connection,
  $numeric,
  $source,
  $target,
  $text 
)

Constructs a numeric event.

Parameters
Erebot::Interfaces::Connection$connectionThe connection this message came from.
int$numericThe numeric code for the message.
string$sourceThe source of the numeric message. This will generally be the name of an IRC server.
string$targetThe target of the numeric message. This will generally be the bot's nickname.
string$textThe numeric content of the message.
Note
No attempt is made at parsing the content of the message.

Definition at line 65 of file Numeric.php.

References Erebot\Event\Numeric\$connection, Erebot\Event\Numeric\$numeric, Erebot\Event\Numeric\$source, Erebot\Event\Numeric\$target, and Erebot\Event\Numeric\$text.

Member Function Documentation

Erebot\Event\Numeric::getCode ( )

Returns the numeric code associated with the current message.

Return values
intThe numeric code of this message.
Note
Multiple constants may point to the same code as the same code may have different interpretations depending on the server (IRCd) where it is used.

Implements Erebot\Interfaces\Event\Numeric.

Definition at line 90 of file Numeric.php.

References Erebot\Event\Numeric\$numeric.

Erebot\Event\Numeric::getConnection ( )

Returns the connection this event came from. This is the same object as that passed during construction.

Return values
Erebot::Interfaces::ConnectionThe connection this event came from.

Implements Erebot\Interfaces\Event\Base\Generic.

Definition at line 85 of file Numeric.php.

References Erebot\Event\Numeric\$connection.

Erebot\Event\Numeric::getSource ( )

Returns the source of the current message. This will usually be some user's nickname or the name of an IRC server.

Return values
Erebot::Interfaces::IdentityThe source of this message.

Implements Erebot\Interfaces\Event\Base\Source.

Definition at line 95 of file Numeric.php.

References Erebot\Event\Numeric\$source.

Erebot\Event\Numeric::getTarget ( )

Returns the target of the current message. This will generally be the bot's nickname or some other user's nickname.

Return values
stringThe target of this message.

Implements Erebot\Interfaces\Event\Base\Target.

Definition at line 100 of file Numeric.php.

References Erebot\Event\Numeric\$target.

Erebot\Event\Numeric::getText ( )

Returns the raw content of the current message. No attempt is made at parsing the content.

Return values
stringThe content of this message.

Implements Erebot\Interfaces\Event\Base\Text.

Definition at line 105 of file Numeric.php.

References Erebot\Event\Numeric\$text.

Erebot\Event\Numeric::preventDefault (   $prevent = null)

Prevents the default action associated with this type of event from occuring.

Parameters
mixed$prevent(optional) Whether the default action should be prevented (true) or not (false). You may also pass the value null to retrieve the current value without modifying it.
Return values
boolPrevious value (if modified by this call), or current value (if the value null was passed to $prevent).

Implements Erebot\Interfaces\Event\Base\Generic.

Definition at line 110 of file Numeric.php.

References Erebot\Event\Numeric\$halt.


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