]> git.mxchange.org Git - friendica.git/blob - src/Object/Notification/Notification.php
update PHPDoc
[friendica.git] / src / Object / Notification / Notification.php
1 <?php
2
3 namespace Friendica\Object\Notification;
4
5 /**
6  * A view-only object for printing item notifications to the frontend
7  */
8 class Notification implements \JsonSerializable
9 {
10         const SYSTEM   = 'system';
11         const PERSONAL = 'personal';
12         const NETWORK  = 'network';
13         const INTRO    = 'intro';
14         const HOME     = 'home';
15
16         /** @var string */
17         private $label = '';
18         /** @var string */
19         private $link = '';
20         /** @var string */
21         private $image = '';
22         /** @var string */
23         private $url = '';
24         /** @var string */
25         private $text = '';
26         /** @var string */
27         private $when = '';
28         /** @var string */
29         private $ago = '';
30         /** @var boolean */
31         private $seen = false;
32
33         /**
34          * @return string
35          */
36         public function getLabel()
37         {
38                 return $this->label;
39         }
40
41         /**
42          * @return string
43          */
44         public function getLink()
45         {
46                 return $this->link;
47         }
48
49         /**
50          * @return string
51          */
52         public function getImage()
53         {
54                 return $this->image;
55         }
56
57         /**
58          * @return string
59          */
60         public function getUrl()
61         {
62                 return $this->url;
63         }
64
65         /**
66          * @return string
67          */
68         public function getText()
69         {
70                 return $this->text;
71         }
72
73         /**
74          * @return string
75          */
76         public function getWhen()
77         {
78                 return $this->when;
79         }
80
81         /**
82          * @return string
83          */
84         public function getAgo()
85         {
86                 return $this->ago;
87         }
88
89         /**
90          * @return bool
91          */
92         public function isSeen()
93         {
94                 return $this->seen;
95         }
96
97         public function __construct(string $label = '', string $link = '', string $image = '',
98                                     string $url = '', string $text = '',
99                                     string $when = '', string $ago = '', bool $seen = false)
100         {
101                 $this->label = $label;
102                 $this->link  = $link;
103                 $this->image = $image;
104                 $this->url   = $url;
105                 $this->text  = $text;
106                 $this->when  = $when;
107                 $this->ago   = $ago;
108                 $this->seen  = $seen;
109         }
110
111         /**
112          * @inheritDoc
113          */
114         public function jsonSerialize()
115         {
116                 return get_object_vars($this);
117         }
118
119         /**
120          * @return array
121          */
122         public function toArray()
123         {
124                 return get_object_vars($this);
125         }
126 }