PHP Class PAMI\Message\Message

Show file Open project: marcelog/pami

Protected Properties

Property Type Description
$createdDate integer Created date (unix timestamp).
$keys string[] Metadata. Message "keys" i.e: Action: login
$lines string[] Message content, line by line. This is what it gets sent or received literally.
$variables string[] Metadata. Message variables (key/value).

Public Methods

Method Description
__construct ( ) : void Constructor.
__sleep ( ) : string[] Serialize function.
getActionID ( ) : string Returns key: 'ActionID'.
getCreatedDate ( ) : integer Returns created date.
getKey ( string $key ) : string Returns a key by name.
getKeys ( ) : string[] Returns all keys for this message.
getVariable ( string $key ) : string Returns a variable by name.
getVariables ( ) : string[] Returns all variabels for this message.
serialize ( ) : string Gives a string representation for this message, ready to be sent to ami.
setVariable ( string $key, string $value ) : void Adds a variable to this message.

Protected Methods

Method Description
finishMessage ( $message ) : string Returns the end of message token appended to the end of a given message.
setKey ( string $key, string $value ) : void Adds a variable to this message.

Private Methods

Method Description
serializeVariable ( string $key, string $value ) : string Returns the string representation for an ami action variable.

Method Details

__construct() public method

Constructor.
public __construct ( ) : void
return void

__sleep() public method

Serialize function.
public __sleep ( ) : string[]
return string[]

finishMessage() protected method

Returns the end of message token appended to the end of a given message.
protected finishMessage ( $message ) : string
return string

getActionID() public method

Returns key: 'ActionID'.
public getActionID ( ) : string
return string

getCreatedDate() public method

Returns created date.
public getCreatedDate ( ) : integer
return integer

getKey() public method

Returns a key by name.
public getKey ( string $key ) : string
$key string Key name (i.e: Action).
return string

getKeys() public method

Returns all keys for this message.
public getKeys ( ) : string[]
return string[]

getVariable() public method

Returns a variable by name.
public getVariable ( string $key ) : string
$key string Variable name.
return string

getVariables() public method

Returns all variabels for this message.
public getVariables ( ) : string[]
return string[]

serialize() public method

Gives a string representation for this message, ready to be sent to ami.
public serialize ( ) : string
return string

setKey() protected method

Adds a variable to this message.
protected setKey ( string $key, string $value ) : void
$key string Key name (i.e: Action).
$value string Key value.
return void

setVariable() public method

Adds a variable to this message.
public setVariable ( string $key, string $value ) : void
$key string Variable name.
$value string Variable value.
return void

Property Details

$createdDate protected property

Created date (unix timestamp).
protected int $createdDate
return integer

$keys protected property

Metadata. Message "keys" i.e: Action: login
protected string[] $keys
return string[]

$lines protected property

Message content, line by line. This is what it gets sent or received literally.
protected string[] $lines
return string[]

$variables protected property

Metadata. Message variables (key/value).
protected string[] $variables
return string[]