Elgg  Version 6.1
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ElggSystemMessage Class Reference

Elgg System Message. More...

Public Member Functions

 __construct (string $message, string $type= 'success')
 constructor More...
 
 setMessage (string $message)
 Set the message. More...
 
 getMessage ()
 Returns the message. More...
 
 setType (string $type)
 Set the type. More...
 
 getType ()
 Returns the message type. More...
 
 setTtl (int $ttl)
 Set the time to live. More...
 
 getTtl ()
 Returns the time to live. More...
 
 getVars (array $extras=[])
 Returns the extra vars set during the factory. More...
 
 __toString ()
 This magic method is used for setting a string value for the object. More...
 

Static Public Member Functions

static factory (array $options)
 Create an ElggSystemMessage from an associative array. More...
 

Protected Attributes

 $message
 
 $ttl = -1
 
 $type
 
 $vars = []
 
 $link = ''
 

Detailed Description

Elgg System Message.

Holds information about a single system message.

Since
4.2.0

Definition at line 10 of file ElggSystemMessage.php.

Constructor & Destructor Documentation

ElggSystemMessage::__construct ( string  $message,
string  $type = 'success' 
)

constructor

Parameters
string$messageMessage text
string$typeMessage type

Definition at line 43 of file ElggSystemMessage.php.

Member Function Documentation

ElggSystemMessage::__toString ( )

This magic method is used for setting a string value for the object.

It will be used if the object is used as a string.

Returns
string

Definition at line 153 of file ElggSystemMessage.php.

array additional variables set in the ElggSystemMessage::factory ( array  $options)
static

Create an ElggSystemMessage from an associative array.

Required key is 'message'.

Commonly used params: type => STR Message type (required) message => STR Message text ttl => INT Time to live before the message is hidden link => STR Additional html to show in the message as an action related to the message

Additional vars are stored in message vars (retrievable with getVars)

Parameters
array$optionsOption array of key value pairs
Returns

Definition at line 63 of file ElggSystemMessage.php.

ElggSystemMessage::getMessage ( )

Returns the message.

Returns
string

Definition at line 94 of file ElggSystemMessage.php.

ElggSystemMessage::getTtl ( )

Returns the time to live.

Returns
int

Definition at line 133 of file ElggSystemMessage.php.

ElggSystemMessage::getType ( )

Returns the message type.

Returns
string

Definition at line 113 of file ElggSystemMessage.php.

ElggSystemMessage::getVars ( array  $extras = [])

Returns the extra vars set during the factory.

Parameters
array$extrasadditional vars to merge into the vars
Returns
array

Definition at line 144 of file ElggSystemMessage.php.

ElggSystemMessage::setMessage ( string  $message)

Set the message.

Parameters
string$messagemessage text
Returns
void

Definition at line 85 of file ElggSystemMessage.php.

ElggSystemMessage::setTtl ( int  $ttl)

Set the time to live.

Parameters
int$ttlnumber of seconds before autohide
Returns
void

Definition at line 124 of file ElggSystemMessage.php.

ElggSystemMessage::setType ( string  $type)

Set the type.

Parameters
string$typemessage type
Returns
void

Definition at line 104 of file ElggSystemMessage.php.

Member Data Documentation

ElggSystemMessage::$link = ''
protected

Definition at line 35 of file ElggSystemMessage.php.

ElggSystemMessage::$message
protected

Definition at line 15 of file ElggSystemMessage.php.

ElggSystemMessage::$ttl = -1
protected

Definition at line 20 of file ElggSystemMessage.php.

ElggSystemMessage::$type
protected

Definition at line 25 of file ElggSystemMessage.php.

ElggSystemMessage::$vars = []
protected

Definition at line 30 of file ElggSystemMessage.php.


The documentation for this class was generated from the following file: