Phergie
[ class tree: Phergie ] [ index: Phergie ] [ all elements ]

Class: Phergie_Event_Request

Source Location: /Phergie/Event/Request.php

Class Overview

Phergie_Event_Abstract
   |
   --Phergie_Event_Request

Autonomous event originating from a user or the server.


Author(s):

Implements interfaces:

  • ArrayAccess (internal interface)

Variables

Constants

Methods


Child classes:

Phergie_Event_Command
Event originating from a plugin for the bot.

Inherited Variables

Inherited Methods


Class Details

[line 32]
Autonomous event originating from a user or the server.



Tags:



[ Top ]


Class Variables

static $map = array(

        self::TYPE_NICK => array(
            'nickname' => 0
        ),self::TYPE_WHOIS=>array('nickmask'=>0),self::TYPE_QUIT=>array('message'=>0),self::TYPE_JOIN=>array('channel'=>0,'keys'=>1),self::TYPE_KICK=>array('channel'=>0,'user'=>1,'comment'=>2),self::TYPE_PART=>array('channel'=>0,'message'=>1),self::TYPE_INVITE=>array('nickname'=>0,'channel'=>1),self::TYPE_MODE=>array('target'=>0,'mode'=>1,'limit'=>2,'user'=>3,'banmask'=>4),self::TYPE_TOPIC=>array('channel'=>0,'topic'=>1),self::TYPE_PRIVMSG=>array('receiver'=>0,'text'=>1),self::TYPE_NOTICE=>array('nickname'=>0,'text'=>1),self::TYPE_PONG=>array('server'=>0),self::TYPE_ACTION=>array('target'=>0,'text'=>1),self::TYPE_PING=>array('nick'=>0,'hash'=>1),self::TYPE_ERROR=>array('message'=>0),self::TYPE_TIME=>array('reply'=>0),self::TYPE_VERSION=>array('reply'=>0),self::TYPE_FINGER=>array('reply'=>0),self::TYPE_RAW=>array('message'=>0),)

[line 136]

Mapping of event types to their named parameters



Tags:

access:  protected

Type:   array


[ Top ]

$arguments = array()

[line 242]

Arguments included with the message



Tags:

access:  protected

Type:   array


[ Top ]

$hostmask =

[line 235]

Hostmask representing the originating user, if applicable



Tags:

access:  protected

Type:   Phergie_Hostmask


[ Top ]

$rawData =

[line 249]

Raw data sent by the server



Tags:

access:  protected

Type:   string


[ Top ]



Class Methods


static method getArgumentMapping [line 567]

static array getArgumentMapping( )

Returns a mapping of commands to their respective arguments.



Tags:

return:  Associative array keyed by command referencing an associative array keyed by argument name referencing its position starting from 0
access:  public


[ Top ]

method getArgument [line 378]

string|null getArgument( mixed $argument)

Returns a single specified argument for the request.



Tags:

return:  Argument value or NULL if none is set
access:  public


Parameters:

mixed   $argument   Integer position (starting from 0) or the equivalent string name of the argument from self::$map

[ Top ]

method getArguments [line 316]

array getArguments( )

Returns the arguments for the request.



Tags:

access:  public


[ Top ]

method getHostmask [line 269]

Phergie_Event_Request|null getHostmask( )

Returns the hostmask representing the originating user.



Tags:

return:  Hostmask or NULL if none was set
access:  public


[ Top ]

method getNick [line 415]

string getNick( )

Returns the nick of the user who originated the event.



Tags:

access:  public


[ Top ]

method getRawData [line 405]

string getRawData( )

Returns the raw buffer sent from the server for the event.



Tags:

access:  public


[ Top ]

method getSource [line 441]

string getSource( )

Returns the channel name if the event occurred in a channel or the user nick if the event was a private message directed at the bot by a user.



Tags:

access:  public


[ Top ]

method isChannelName [line 428]

bool isChannelName( string $string)

Determines whether a given string is a valid IRC channel name.



Tags:

return:  TRUE if $string contains a valid channel name, FALSE otherwise
access:  protected


Parameters:

string   $string   String to analyze

[ Top ]

method isFromServer [line 477]

TRUE isFromServer( )

Returns whether or not the event originated from the server.



Tags:

return:  if the event is from the server, FALSE otherwise
access:  public


[ Top ]

method isFromUser [line 466]

TRUE isFromUser( )

Returns whether or not the event originated from a user.



Tags:

return:  if the event is from a user, FALSE otherwise
access:  public


[ Top ]

method isInChannel [line 456]

TRUE isInChannel( )

Returns whether or not the event occurred within a channel.



Tags:

return:  if the event is in a channel, FALSE otherwise
access:  public


[ Top ]

method offsetExists [line 511]

bool offsetExists( string|int $offset)

Checks to see if an event argument is assigned a value.



Tags:

return:  TRUE if the argument has a value, FALSE otherwise
see:  ArrayAccess::offsetExists()
access:  public



Implementation of:
ArrayAccess::offsetExists

Parameters:

string|int   $offset   Argument name or position beginning from 0

[ Top ]

method offsetGet [line 528]

string|null offsetGet( string|int $offset)

Returns the value of an event argument.



Tags:

return:  Argument value or NULL if none is set
see:  ArrayAccess::offsetGet()
access:  public



Implementation of:
ArrayAccess::offsetGet

Parameters:

string|int   $offset   Argument name or position beginning from 0

[ Top ]

method offsetSet [line 542]

void offsetSet( string|int $offset, string $value)

Sets the value of an event argument.



Tags:

see:  ArrayAccess::offsetSet()
access:  public



Implementation of:
ArrayAccess::offsetSet

Parameters:

string|int   $offset   Argument name or position beginning from 0
string   $value   New argument value

[ Top ]

method offsetUnset [line 555]

void offsetUnset( string|int $offset)

Removes the value set for an event argument.



Tags:

see:  ArrayAccess::offsetUnset()
access:  public



Implementation of:
ArrayAccess::offsetUnset

Parameters:

string|int   $offset   Argument name or position beginning from 0

[ Top ]

method removeArgument [line 329]

Phergie_Event_Request removeArgument( mixed $argument)

Removes an argument value from the request.



Tags:

return:  Provides a fluent interface
access:  public


Parameters:

mixed   $argument   Integer position (starting from 0) or the equivalent string name of the argument from self::$map

[ Top ]

method resolveArgument [line 344]

int resolveArgument( mixed $argument)

Resolves an argument specification to an integer position.



Tags:

return:  Integer position of the argument
access:  protected


Parameters:

mixed   $argument   Integer position (starting from 0) or the equivalent string name of the argument from self::$map

[ Top ]

method setArgument [line 304]

Phergie_Event_Request setArgument( mixed $argument, string $value)

Sets the value of a single argument for the request.



Tags:

return:  Provides a fluent interface
access:  public


Parameters:

mixed   $argument   Integer position (starting from 0) or the equivalent string name of the argument from self::$map
string   $value   Value to assign to the argument

[ Top ]

method setArguments [line 287]

Phergie_Event_Request setArguments( $arguments)

Sets the arguments for the request.



Tags:

return:  Provides a fluent interface
access:  public


Parameters:

array   $arguments   Request arguments

[ Top ]

method setHostmask [line 258]

Phergie_Event_Request setHostmask( Phergie_Hostmask $hostmask)

Sets the hostmask representing the originating user.



Tags:

return:  Provides a fluent interface
access:  public


Parameters:

Phergie_Hostmask   $hostmask   User hostmask

[ Top ]

method setRawData [line 394]

Phergie_Event_Request setRawData( string $buffer)

Sets the raw buffer for the event.



Tags:

return:  Provides a fluent interface
access:  public


Parameters:

string   $buffer   Raw event buffer

[ Top ]

method __call [line 492]

mixed __call( string $name, $arguments)

Provides access to named parameters via virtual "getter" methods.



Tags:

return:  Method return value
access:  public


Parameters:

string   $name   Name of the method called
array   $arguments   Arguments passed to the method (should always be empty)

[ Top ]


Class Constants

TYPE_ACTION =  'action'

[line 99]

CTCP ACTION command event type


[ Top ]

TYPE_ERROR =  'error'

[line 124]

ERROR message type


[ Top ]

TYPE_FINGER =  'finger'

[line 119]

CTCP FINGER command event type


[ Top ]

TYPE_INVITE =  'invite'

[line 69]

Invite message event type


[ Top ]

TYPE_JOIN =  'join'

[line 54]

Join message event type


[ Top ]

TYPE_KICK =  'kick'

[line 59]

Kick message event type


[ Top ]

TYPE_MODE =  'mode'

[line 74]

Mode message event type


[ Top ]

TYPE_NICK =  'nick'

[line 39]

Nick message event type


[ Top ]

TYPE_NOTICE =  'notice'

[line 89]

Notice message event type


[ Top ]

TYPE_PART =  'part'

[line 64]

Part message event type


[ Top ]

TYPE_PING =  'ping'

[line 104]

CTCP PING command event type


[ Top ]

TYPE_PONG =  'pong'

[line 94]

Pong message event type


[ Top ]

TYPE_PRIVMSG =  'privmsg'

[line 84]

Private message command event type


[ Top ]

TYPE_QUIT =  'quit'

[line 49]

Quit command event type


[ Top ]

TYPE_RAW =  'raw'

[line 129]

Raw event type


[ Top ]

TYPE_TIME =  'time'

[line 109]

CTCP TIME command event type


[ Top ]

TYPE_TOPIC =  'topic'

[line 79]

Topic message event type


[ Top ]

TYPE_VERSION =  'version'

[line 114]

CTCP VERSION command event type


[ Top ]

TYPE_WHOIS =  'whois'

[line 44]

Whois message event type


[ Top ]



Documentation generated on Mon, 27 Sep 2010 23:03:48 -0500 by phpDocumentor 1.4.3