]> git.mxchange.org Git - friendica.git/blob - src/Object/Notification/Introduction.php
Refactor API notification usage
[friendica.git] / src / Object / Notification / Introduction.php
1 <?php
2
3 namespace Friendica\Object\Notification;
4
5 /**
6  * A view-only object for printing introduction notifications to the frontend
7  */
8 class Introduction implements \JsonSerializable
9 {
10         /** @var string */
11         private $label = '';
12         /** @var string */
13         private $type = '';
14         /** @var integer */
15         private $intro_id = -1;
16         /** @var string */
17         private $madeBy = '';
18         /** @var string */
19         private $madeByUrl = '';
20         /** @var string */
21         private $madeByZrl = '';
22         /** @var string */
23         private $madeByAddr = '';
24         /** @var integer */
25         private $contactId = -1;
26         /** @var string */
27         private $photo = '';
28         /** @var string */
29         private $name = '';
30         /** @var string */
31         private $url = '';
32         /** @var string */
33         private $zrl = '';
34         /** @var boolean */
35         private $hidden = false;
36         /** @var integer */
37         private $postNewFriend = -1;
38         /** @var boolean */
39         private $knowYou = false;
40         /** @var string */
41         private $note = '';
42         /** @var string */
43         private $request = '';
44         /** @var int */
45         private $dfrnId = -1;
46         /** @var string */
47         private $addr = '';
48         /** @var string */
49         private $network = '';
50         /** @var int */
51         private $uid = -1;
52         /** @var string */
53         private $keywords = '';
54         /** @var string */
55         private $gender = '';
56         /** @var string */
57         private $location = '';
58         /** @var string */
59         private $about = '';
60
61         /**
62          * @return string
63          */
64         public function getLabel()
65         {
66                 return $this->label;
67         }
68
69         /**
70          * @return string
71          */
72         public function getType()
73         {
74                 return $this->type;
75         }
76
77         /**
78          * @return int
79          */
80         public function getIntroId()
81         {
82                 return $this->intro_id;
83         }
84
85         /**
86          * @return string
87          */
88         public function getMadeBy()
89         {
90                 return $this->madeBy;
91         }
92
93         /**
94          * @return string
95          */
96         public function getMadeByUrl()
97         {
98                 return $this->madeByUrl;
99         }
100
101         /**
102          * @return string
103          */
104         public function getMadeByZrl()
105         {
106                 return $this->madeByZrl;
107         }
108
109         /**
110          * @return string
111          */
112         public function getMadeByAddr()
113         {
114                 return $this->madeByAddr;
115         }
116
117         /**
118          * @return int
119          */
120         public function getContactId()
121         {
122                 return $this->contactId;
123         }
124
125         /**
126          * @return string
127          */
128         public function getPhoto()
129         {
130                 return $this->photo;
131         }
132
133         /**
134          * @return string
135          */
136         public function getName()
137         {
138                 return $this->name;
139         }
140
141         /**
142          * @return string
143          */
144         public function getUrl()
145         {
146                 return $this->url;
147         }
148
149         /**
150          * @return string
151          */
152         public function getZrl()
153         {
154                 return $this->zrl;
155         }
156
157         /**
158          * @return bool
159          */
160         public function isHidden()
161         {
162                 return $this->hidden;
163         }
164
165         /**
166          * @return int
167          */
168         public function getPostNewFriend()
169         {
170                 return $this->postNewFriend;
171         }
172
173         /**
174          * @return string
175          */
176         public function getKnowYou()
177         {
178                 return $this->knowYou;
179         }
180
181         /**
182          * @return string
183          */
184         public function getNote()
185         {
186                 return $this->note;
187         }
188
189         /**
190          * @return string
191          */
192         public function getRequest()
193         {
194                 return $this->request;
195         }
196
197         /**
198          * @return string
199          */
200         public function getDfrnId()
201         {
202                 return $this->dfrnId;
203         }
204
205         /**
206          * @return string
207          */
208         public function getAddr()
209         {
210                 return $this->addr;
211         }
212
213         /**
214          * @return string
215          */
216         public function getNetwork()
217         {
218                 return $this->network;
219         }
220
221         /**
222          * @return int
223          */
224         public function getUid()
225         {
226                 return $this->uid;
227         }
228
229         /**
230          * @return string
231          */
232         public function getKeywords()
233         {
234                 return $this->keywords;
235         }
236
237         /**
238          * @return string
239          */
240         public function getGender()
241         {
242                 return $this->gender;
243         }
244
245         /**
246          * @return string
247          */
248         public function getLocation()
249         {
250                 return $this->location;
251         }
252
253         /**
254          * @return string
255          */
256         public function getAbout()
257         {
258                 return $this->about;
259         }
260
261         public function __construct(array $data = [])
262         {
263                 $this->label         = $data['label'] ?? '';
264                 $this->type          = $data['str_type'] ?? '';
265                 $this->intro_id      = $data['$intro_id'] ?? -1;
266                 $this->madeBy        = $data['madeBy'] ?? '';
267                 $this->madeByUrl     = $data['madeByUrl'] ?? '';
268                 $this->madeByZrl     = $data['madeByZrl'] ?? '';
269                 $this->madeByAddr    = $data['madeByAddr'] ?? '';
270                 $this->contactId     = $data['contactId'] ?? '';
271                 $this->photo         = $data['photo'] ?? '';
272                 $this->name          = $data['name'] ?? '';
273                 $this->url           = $data['url'] ?? '';
274                 $this->zrl           = $data['zrl'] ?? '';
275                 $this->hidden        = $data['hidden'] ?? false;
276                 $this->postNewFriend = $data['postNewFriend'] ?? '';
277                 $this->knowYou       = $data['knowYou'] ?? false;
278                 $this->note          = $data['note'] ?? '';
279                 $this->request       = $data['request'] ?? '';
280                 $this->dfrnId        = $data['dfrn_id'] ?? -1;
281                 $this->addr          = $data['addr'] ?? '';
282                 $this->network       = $data['network'] ?? '';
283                 $this->uid           = $data['uid'] ?? -1;
284                 $this->keywords      = $data['keywords'] ?? '';
285                 $this->gender        = $data['gender'] ?? '';
286                 $this->location      = $data['location'] ?? '';
287                 $this->about         = $data['about'] ?? '';
288         }
289
290         /**
291          * @inheritDoc
292          */
293         public function jsonSerialize()
294         {
295                 return $this->toArray();
296         }
297
298         /**
299          * @return array
300          */
301         public function toArray()
302         {
303                 return get_object_vars($this);
304         }
305 }