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