Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
Notification.php
Go to the documentation of this file.
1 <?php
2 namespace Elgg\Notifications;
3 
11 class Notification {
13  protected $from;
14 
16  protected $to;
17 
19  public $summary;
20 
22  public $subject;
23 
25  public $body;
26 
28  public $language;
29 
31  public $params;
32 
45  public function __construct(\ElggEntity $from, \ElggEntity $to, $language, $subject, $body, $summary = '', array $params = array()) {
46  if (!$from) {
47  throw new \InvalidArgumentException('$from is not a valid \ElggEntity');
48  }
49  if (!$to) {
50  throw new \InvalidArgumentException('$to is not a valid \ElggEntity');
51  }
52  $this->from = $from;
53  $this->to = $to;
54  $this->language = $language;
55  $this->subject = $subject;
56  $this->body = $body;
57  $this->summary = $summary;
58  $this->params = $params;
59  }
60 
66  public function getSender() {
67  return $this->from;
68  }
69 
75  public function getSenderGUID() {
76  return $this->from->guid;
77  }
78 
84  public function getRecipient() {
85  return $this->to;
86  }
87 
93  public function getRecipientGUID() {
94  return $this->to->guid;
95  }
96 }
97 
getRecipient()
Get the recipient entity.
$CONFIG language
The current language for either the site or the user.
Definition: config.php:51
body
Definition: admin.css.php:36
getRecipientGUID()
Get the recipient entity guid.
getSender()
Get the sender entity.
__construct(\ElggEntity $from,\ElggEntity $to, $language, $subject, $body, $summary= '', array $params=array())
Create a notification.
getSenderGUID()
Get the sender entity guid.