PHP Class Phergie_Event_Request, phergie

Inheritance: extends Phergie_Event_Abstract, implements ArrayAccess
Afficher le fichier Open project: phergie/phergie Class Usage Examples

Protected Properties

Свойство Type Description
$arguments array Arguments included with the message
$hostmask Phergie_Hostmask Hostmask representing the originating user, if applicable
$map array Mapping of event types to their named parameters
$rawData string Raw data sent by the server

Méthodes publiques

Méthode Description
__call ( string $name, array $arguments ) : mixed Provides access to named parameters via virtual "getter" methods.
getArgument ( mixed $argument ) : string | null Returns a single specified argument for the request.
getArgumentMapping ( ) : array Returns a mapping of commands to their respective arguments.
getArguments ( ) : array Returns the arguments for the request.
getHostmask ( ) : Phergie_Event_Request | null Returns the hostmask representing the originating user.
getNick ( ) : string Returns the nick of the user who originated the event.
getRawData ( ) : string Returns the raw buffer sent from the server for the event.
getSource ( ) : string 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.
isFromServer ( ) : TRUE Returns whether or not the event originated from the server.
isFromUser ( ) : TRUE Returns whether or not the event originated from a user.
isInChannel ( ) : TRUE Returns whether or not the event occurred within a channel.
offsetExists ( string | integer $offset ) : boolean Checks to see if an event argument is assigned a value.
offsetGet ( string | integer $offset ) : string | null Returns the value of an event argument.
offsetSet ( string | integer $offset, string $value ) : void Sets the value of an event argument.
offsetUnset ( string | integer $offset ) : void Removes the value set for an event argument.
removeArgument ( mixed $argument ) : Phergie_Event_Request Removes an argument value from the request.
setArgument ( mixed $argument, string $value ) : Phergie_Event_Request Sets the value of a single argument for the request.
setArguments ( array $arguments ) : Phergie_Event_Request Sets the arguments for the request.
setHostmask ( Phergie_Hostmask $hostmask ) : Phergie_Event_Request Sets the hostmask representing the originating user.
setRawData ( string $buffer ) : Phergie_Event_Request Sets the raw buffer for the event.

Méthodes protégées

Méthode Description
isChannelName ( string $string ) : boolean Determines whether a given string is a valid IRC channel name.
resolveArgument ( mixed $argument ) : integer Resolves an argument specification to an integer position.

Method Details

__call() public méthode

Provides access to named parameters via virtual "getter" methods.
public __call ( string $name, array $arguments ) : mixed
$name string Name of the method called
$arguments array Arguments passed to the method (should always be empty)
Résultat mixed Method return value

getArgument() public méthode

Returns a single specified argument for the request.
public getArgument ( mixed $argument ) : string | null
$argument mixed Integer position (starting from 0) or the equivalent string name of the argument from self::$map
Résultat string | null Argument value or NULL if none is set

getArgumentMapping() public static méthode

Returns a mapping of commands to their respective arguments.
public static getArgumentMapping ( ) : array
Résultat array Associative array keyed by command referencing an associative array keyed by argument name referencing its position starting from 0

getArguments() public méthode

Returns the arguments for the request.
public getArguments ( ) : array
Résultat array

getHostmask() public méthode

Returns the hostmask representing the originating user.
public getHostmask ( ) : Phergie_Event_Request | null
Résultat Phergie_Event_Request | null Hostmask or NULL if none was set

getNick() public méthode

Returns the nick of the user who originated the event.
public getNick ( ) : string
Résultat string

getRawData() public méthode

Returns the raw buffer sent from the server for the event.
public getRawData ( ) : string
Résultat string

getSource() public méthode

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.
public getSource ( ) : string
Résultat string

isChannelName() protected méthode

Determines whether a given string is a valid IRC channel name.
protected isChannelName ( string $string ) : boolean
$string string String to analyze
Résultat boolean TRUE if $string contains a valid channel name, FALSE otherwise

isFromServer() public méthode

Returns whether or not the event originated from the server.
public isFromServer ( ) : TRUE
Résultat TRUE if the event is from the server, FALSE otherwise

isFromUser() public méthode

Returns whether or not the event originated from a user.
public isFromUser ( ) : TRUE
Résultat TRUE if the event is from a user, FALSE otherwise

isInChannel() public méthode

Returns whether or not the event occurred within a channel.
public isInChannel ( ) : TRUE
Résultat TRUE if the event is in a channel, FALSE otherwise

offsetExists() public méthode

Checks to see if an event argument is assigned a value.
See also: ArrayAccess::offsetExists()
public offsetExists ( string | integer $offset ) : boolean
$offset string | integer Argument name or position beginning from 0
Résultat boolean TRUE if the argument has a value, FALSE otherwise

offsetGet() public méthode

Returns the value of an event argument.
See also: ArrayAccess::offsetGet()
public offsetGet ( string | integer $offset ) : string | null
$offset string | integer Argument name or position beginning from 0
Résultat string | null Argument value or NULL if none is set

offsetSet() public méthode

Sets the value of an event argument.
See also: ArrayAccess::offsetSet()
public offsetSet ( string | integer $offset, string $value ) : void
$offset string | integer Argument name or position beginning from 0
$value string New argument value
Résultat void

offsetUnset() public méthode

Removes the value set for an event argument.
See also: ArrayAccess::offsetUnset()
public offsetUnset ( string | integer $offset ) : void
$offset string | integer Argument name or position beginning from 0
Résultat void

removeArgument() public méthode

Removes an argument value from the request.
public removeArgument ( mixed $argument ) : Phergie_Event_Request
$argument mixed Integer position (starting from 0) or the equivalent string name of the argument from self::$map
Résultat Phergie_Event_Request Provides a fluent interface

resolveArgument() protected méthode

Resolves an argument specification to an integer position.
protected resolveArgument ( mixed $argument ) : integer
$argument mixed Integer position (starting from 0) or the equivalent string name of the argument from self::$map
Résultat integer Integer position of the argument

setArgument() public méthode

Sets the value of a single argument for the request.
public setArgument ( mixed $argument, string $value ) : Phergie_Event_Request
$argument mixed Integer position (starting from 0) or the equivalent string name of the argument from self::$map
$value string Value to assign to the argument
Résultat Phergie_Event_Request Provides a fluent interface

setArguments() public méthode

Sets the arguments for the request.
public setArguments ( array $arguments ) : Phergie_Event_Request
$arguments array Request arguments
Résultat Phergie_Event_Request Provides a fluent interface

setHostmask() public méthode

Sets the hostmask representing the originating user.
public setHostmask ( Phergie_Hostmask $hostmask ) : Phergie_Event_Request
$hostmask Phergie_Hostmask User hostmask
Résultat Phergie_Event_Request Provides a fluent interface

setRawData() public méthode

Sets the raw buffer for the event.
public setRawData ( string $buffer ) : Phergie_Event_Request
$buffer string Raw event buffer
Résultat Phergie_Event_Request Provides a fluent interface

Property Details

$arguments protected_oe property

Arguments included with the message
protected array $arguments
Résultat array

$hostmask protected_oe property

Hostmask representing the originating user, if applicable
protected Phergie_Hostmask $hostmask
Résultat Phergie_Hostmask

$map protected_oe static_oe property

Mapping of event types to their named parameters
protected static array $map
Résultat array

$rawData protected_oe property

Raw data sent by the server
protected string $rawData
Résultat string