PHP Класс Phergie_Event_Request, phergie

Автор: Phergie Development Team ([email protected])
Наследование: extends Phergie_Event_Abstract, implements ArrayAccess
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
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.

Описание методов

__call() публичный Метод

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)
Результат mixed Method return value

getArgument() публичный Метод

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
Результат string | null Argument value or NULL if none is set

getArgumentMapping() публичный статический Метод

Returns a mapping of commands to their respective arguments.
public static getArgumentMapping ( ) : array
Результат array Associative array keyed by command referencing an associative array keyed by argument name referencing its position starting from 0

getArguments() публичный Метод

Returns the arguments for the request.
public getArguments ( ) : array
Результат array

getHostmask() публичный Метод

Returns the hostmask representing the originating user.
public getHostmask ( ) : Phergie_Event_Request | null
Результат Phergie_Event_Request | null Hostmask or NULL if none was set

getNick() публичный Метод

Returns the nick of the user who originated the event.
public getNick ( ) : string
Результат string

getRawData() публичный Метод

Returns the raw buffer sent from the server for the event.
public getRawData ( ) : string
Результат 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.
public getSource ( ) : string
Результат string

isChannelName() защищенный Метод

Determines whether a given string is a valid IRC channel name.
protected isChannelName ( string $string ) : boolean
$string string String to analyze
Результат boolean TRUE if $string contains a valid channel name, FALSE otherwise

isFromServer() публичный Метод

Returns whether or not the event originated from the server.
public isFromServer ( ) : TRUE
Результат TRUE if the event is from the server, FALSE otherwise

isFromUser() публичный Метод

Returns whether or not the event originated from a user.
public isFromUser ( ) : TRUE
Результат TRUE if the event is from a user, FALSE otherwise

isInChannel() публичный Метод

Returns whether or not the event occurred within a channel.
public isInChannel ( ) : TRUE
Результат TRUE if the event is in a channel, FALSE otherwise

offsetExists() публичный Метод

Checks to see if an event argument is assigned a value.
См. также: ArrayAccess::offsetExists()
public offsetExists ( string | integer $offset ) : boolean
$offset string | integer Argument name or position beginning from 0
Результат boolean TRUE if the argument has a value, FALSE otherwise

offsetGet() публичный Метод

Returns the value of an event argument.
См. также: ArrayAccess::offsetGet()
public offsetGet ( string | integer $offset ) : string | null
$offset string | integer Argument name or position beginning from 0
Результат string | null Argument value or NULL if none is set

offsetSet() публичный Метод

Sets the value of an event argument.
См. также: 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
Результат void

offsetUnset() публичный Метод

Removes the value set for an event argument.
См. также: ArrayAccess::offsetUnset()
public offsetUnset ( string | integer $offset ) : void
$offset string | integer Argument name or position beginning from 0
Результат void

removeArgument() публичный Метод

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
Результат Phergie_Event_Request Provides a fluent interface

resolveArgument() защищенный Метод

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
Результат integer Integer position of the argument

setArgument() публичный Метод

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
Результат Phergie_Event_Request Provides a fluent interface

setArguments() публичный Метод

Sets the arguments for the request.
public setArguments ( array $arguments ) : Phergie_Event_Request
$arguments array Request arguments
Результат Phergie_Event_Request Provides a fluent interface

setHostmask() публичный Метод

Sets the hostmask representing the originating user.
public setHostmask ( Phergie_Hostmask $hostmask ) : Phergie_Event_Request
$hostmask Phergie_Hostmask User hostmask
Результат Phergie_Event_Request Provides a fluent interface

setRawData() публичный Метод

Sets the raw buffer for the event.
public setRawData ( string $buffer ) : Phergie_Event_Request
$buffer string Raw event buffer
Результат Phergie_Event_Request Provides a fluent interface

Описание свойств

$arguments защищенное свойство

Arguments included with the message
protected array $arguments
Результат array

$hostmask защищенное свойство

Hostmask representing the originating user, if applicable
protected Phergie_Hostmask $hostmask
Результат Phergie_Hostmask

$map защищенное статическое свойство

Mapping of event types to their named parameters
protected static array $map
Результат array

$rawData защищенное свойство

Raw data sent by the server
protected string $rawData
Результат string