PHP Class Elgg\Notifications\Notification

Since: 1.10
Exibir arquivo Open project: elgg/elgg Class Usage Examples

Public Properties

Property Type Description
$body The body of the notification. Email body is one use.
$language The language of the notification
$params Additional parameters
$subject The subject of the notification. Email subject is one use.
$summary A single sentence summary string

Protected Properties

Property Type Description
$from The entity causing or creating the notification
$to The user receiving the notification

Public Methods

Method Description
__construct ( ElggEntity $from, ElggEntity $to, string $language, string $subject, string $body, string $summary = '', array $params = [] ) Create a notification
getRecipient ( ) : ElggEntity Get the recipient entity
getRecipientGUID ( ) : integer Get the recipient entity guid
getSender ( ) : ElggEntity Get the sender entity
getSenderGUID ( ) : integer Get the sender entity guid
toObject ( ) : stdClass Export notification

Method Details

__construct() public method

Create a notification
public __construct ( ElggEntity $from, ElggEntity $to, string $language, string $subject, string $body, string $summary = '', array $params = [] )
$from ElggEntity The entity sending the notification (usually the site)
$to ElggEntity The entity receiving the notification
$language string The language code for the notification
$subject string The subject of the notification
$body string The body of the notification
$summary string Optional summary of the notification
$params array Optional array of parameters

getRecipient() public method

Get the recipient entity
public getRecipient ( ) : ElggEntity
return ElggEntity

getRecipientGUID() public method

Get the recipient entity guid
public getRecipientGUID ( ) : integer
return integer

getSender() public method

Get the sender entity
public getSender ( ) : ElggEntity
return ElggEntity

getSenderGUID() public method

Get the sender entity guid
public getSenderGUID ( ) : integer
return integer

toObject() public method

Export notification
public toObject ( ) : stdClass
return stdClass

Property Details

$body public_oe property

The body of the notification. Email body is one use.
public $body

$from protected_oe property

The entity causing or creating the notification
protected $from

$language public_oe property

The language of the notification
public $language

$params public_oe property

Additional parameters
public $params

$subject public_oe property

The subject of the notification. Email subject is one use.
public $subject

$summary public_oe property

A single sentence summary string
public $summary

$to protected_oe property

The user receiving the notification
protected $to