PHP Class Prowl\Message

This class represents a single message to be send by the connector.
Show file Open project: xenji/prowlphp Class Usage Examples

Public Methods

Method Description
addApiKey ( string $sKey ) : Message Sets the api key.
getApiKeysAsArray ( ) : array[string] Returns all actual api keys as array.
getApiKeysAsString ( ) : string Returns all actual api keys as string
getApplication ( ) : string Returns the application string.
getDescription ( ) : string Returns the description.
getEvent ( ) : string Returns the event.
getFilter ( ) : Prowl\Security\Secureable Returns the filter instance, if set. It might return null when no filter is set.
getFilterCallback ( ) : Closure Getter for the filter closure.
getPriority ( ) : integer Returns the priority as signed integer
getUrl ( ) : string Returns the Url that should be sent with the message
removeApiKey ( string $sKey ) : Message Removes an api key from the receiver list.
setApplication ( string $sApp ) : Message Sets the application.
setDescription ( string $sDescription ) : Message Sets the event description.
setEvent ( string $sEvent ) : Message Sets the event.
setFilter ( Prowl\Security\Secureable $oFilterInstance ) : Message Set a filter instance. If you do not need a filter, use the Passthrough filter.
setFilterCallback ( Closure $cCallback ) : void An alternative way to filter. You can set a closure instead of a filter instance. If both are set, the closure will be preferred.
setPriority ( integer $iPriority ) : Message Sets the proirity (-2 to 2) This method uses a fluent interface.
setUrl ( string $sUrl ) : void Sets an Url to be sent with the message.
validate ( ) : boolean Validates the basic needs of the prowl api.

Method Details

addApiKey() public method

This method uses a fluent interface.
public addApiKey ( string $sKey ) : Message
$sKey string An valid api key.
return Message

getApiKeysAsArray() public method

Returns all actual api keys as array.
public getApiKeysAsArray ( ) : array[string]
return array[string]

getApiKeysAsString() public method

Returns all actual api keys as string
public getApiKeysAsString ( ) : string
return string

getApplication() public method

Returns the application string.
public getApplication ( ) : string
return string

getDescription() public method

Returns the description.
public getDescription ( ) : string
return string

getEvent() public method

Returns the event.
public getEvent ( ) : string
return string

getFilter() public method

Returns the filter instance, if set. It might return null when no filter is set.
public getFilter ( ) : Prowl\Security\Secureable
return Prowl\Security\Secureable

getFilterCallback() public method

Getter for the filter closure.
public getFilterCallback ( ) : Closure
return Closure

getPriority() public method

Returns the priority as signed integer
public getPriority ( ) : integer
return integer

getUrl() public method

Returns the Url that should be sent with the message
public getUrl ( ) : string
return string

removeApiKey() public method

Removes an api key from the receiver list.
public removeApiKey ( string $sKey ) : Message
$sKey string
return Message

setApplication() public method

Sets the application.
public setApplication ( string $sApp ) : Message
$sApp string The name of the sending application.
return Message

setDescription() public method

Sets the event description.
public setDescription ( string $sDescription ) : Message
$sDescription string The event description.
return Message

setEvent() public method

Sets the event.
public setEvent ( string $sEvent ) : Message
$sEvent string The event.
return Message

setFilter() public method

Set a filter instance. If you do not need a filter, use the Passthrough filter.
public setFilter ( Prowl\Security\Secureable $oFilterInstance ) : Message
$oFilterInstance Prowl\Security\Secureable
return Message

setFilterCallback() public method

An alternative way to filter. You can set a closure instead of a filter instance. If both are set, the closure will be preferred.
public setFilterCallback ( Closure $cCallback ) : void
$cCallback Closure
return void

setPriority() public method

Sets the proirity (-2 to 2) This method uses a fluent interface.
public setPriority ( integer $iPriority ) : Message
$iPriority integer An signed integer from -2 to 2
return Message

setUrl() public method

Sets an Url to be sent with the message.
public setUrl ( string $sUrl ) : void
$sUrl string
return void

validate() public method

Validates the basic needs of the prowl api.
public validate ( ) : boolean
return boolean