]> git.mxchange.org Git - friendica.git/blob - src/Object/Notification/Introduction.php
Merge pull request #8279 from MrPetovan/task/frio-mobile-actions-buttons
[friendica.git] / src / Object / Notification / Introduction.php
1 <?php
2 /**
3  * @copyright Copyright (C) 2020, Friendica
4  *
5  * @license GNU AGPL version 3 or any later version
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License as
9  * published by the Free Software Foundation, either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Affero General Public License for more details.
16  *
17  * You should have received a copy of the GNU Affero General Public License
18  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19  *
20  */
21
22 namespace Friendica\Object\Notification;
23
24 /**
25  * A view-only object for printing introduction notifications to the frontend
26  */
27 class Introduction implements \JsonSerializable
28 {
29         /** @var string */
30         private $label = '';
31         /** @var string */
32         private $type = '';
33         /** @var integer */
34         private $intro_id = -1;
35         /** @var string */
36         private $madeBy = '';
37         /** @var string */
38         private $madeByUrl = '';
39         /** @var string */
40         private $madeByZrl = '';
41         /** @var string */
42         private $madeByAddr = '';
43         /** @var integer */
44         private $contactId = -1;
45         /** @var string */
46         private $photo = '';
47         /** @var string */
48         private $name = '';
49         /** @var string */
50         private $url = '';
51         /** @var string */
52         private $zrl = '';
53         /** @var boolean */
54         private $hidden = false;
55         /** @var integer */
56         private $postNewFriend = -1;
57         /** @var boolean */
58         private $knowYou = false;
59         /** @var string */
60         private $note = '';
61         /** @var string */
62         private $request = '';
63         /** @var int */
64         private $dfrnId = -1;
65         /** @var string */
66         private $addr = '';
67         /** @var string */
68         private $network = '';
69         /** @var int */
70         private $uid = -1;
71         /** @var string */
72         private $keywords = '';
73         /** @var string */
74         private $gender = '';
75         /** @var string */
76         private $location = '';
77         /** @var string */
78         private $about = '';
79
80         /**
81          * @return string
82          */
83         public function getLabel()
84         {
85                 return $this->label;
86         }
87
88         /**
89          * @return string
90          */
91         public function getType()
92         {
93                 return $this->type;
94         }
95
96         /**
97          * @return int
98          */
99         public function getIntroId()
100         {
101                 return $this->intro_id;
102         }
103
104         /**
105          * @return string
106          */
107         public function getMadeBy()
108         {
109                 return $this->madeBy;
110         }
111
112         /**
113          * @return string
114          */
115         public function getMadeByUrl()
116         {
117                 return $this->madeByUrl;
118         }
119
120         /**
121          * @return string
122          */
123         public function getMadeByZrl()
124         {
125                 return $this->madeByZrl;
126         }
127
128         /**
129          * @return string
130          */
131         public function getMadeByAddr()
132         {
133                 return $this->madeByAddr;
134         }
135
136         /**
137          * @return int
138          */
139         public function getContactId()
140         {
141                 return $this->contactId;
142         }
143
144         /**
145          * @return string
146          */
147         public function getPhoto()
148         {
149                 return $this->photo;
150         }
151
152         /**
153          * @return string
154          */
155         public function getName()
156         {
157                 return $this->name;
158         }
159
160         /**
161          * @return string
162          */
163         public function getUrl()
164         {
165                 return $this->url;
166         }
167
168         /**
169          * @return string
170          */
171         public function getZrl()
172         {
173                 return $this->zrl;
174         }
175
176         /**
177          * @return bool
178          */
179         public function isHidden()
180         {
181                 return $this->hidden;
182         }
183
184         /**
185          * @return int
186          */
187         public function getPostNewFriend()
188         {
189                 return $this->postNewFriend;
190         }
191
192         /**
193          * @return string
194          */
195         public function getKnowYou()
196         {
197                 return $this->knowYou;
198         }
199
200         /**
201          * @return string
202          */
203         public function getNote()
204         {
205                 return $this->note;
206         }
207
208         /**
209          * @return string
210          */
211         public function getRequest()
212         {
213                 return $this->request;
214         }
215
216         /**
217          * @return string
218          */
219         public function getDfrnId()
220         {
221                 return $this->dfrnId;
222         }
223
224         /**
225          * @return string
226          */
227         public function getAddr()
228         {
229                 return $this->addr;
230         }
231
232         /**
233          * @return string
234          */
235         public function getNetwork()
236         {
237                 return $this->network;
238         }
239
240         /**
241          * @return int
242          */
243         public function getUid()
244         {
245                 return $this->uid;
246         }
247
248         /**
249          * @return string
250          */
251         public function getKeywords()
252         {
253                 return $this->keywords;
254         }
255
256         /**
257          * @return string
258          */
259         public function getGender()
260         {
261                 return $this->gender;
262         }
263
264         /**
265          * @return string
266          */
267         public function getLocation()
268         {
269                 return $this->location;
270         }
271
272         /**
273          * @return string
274          */
275         public function getAbout()
276         {
277                 return $this->about;
278         }
279
280         public function __construct(array $data = [])
281         {
282                 $this->label         = $data['label'] ?? '';
283                 $this->type          = $data['str_type'] ?? '';
284                 $this->intro_id      = $data['intro_id'] ?? -1;
285                 $this->madeBy        = $data['madeBy'] ?? '';
286                 $this->madeByUrl     = $data['madeByUrl'] ?? '';
287                 $this->madeByZrl     = $data['madeByZrl'] ?? '';
288                 $this->madeByAddr    = $data['madeByAddr'] ?? '';
289                 $this->contactId     = $data['contactId'] ?? '';
290                 $this->photo         = $data['photo'] ?? '';
291                 $this->name          = $data['name'] ?? '';
292                 $this->url           = $data['url'] ?? '';
293                 $this->zrl           = $data['zrl'] ?? '';
294                 $this->hidden        = $data['hidden'] ?? false;
295                 $this->postNewFriend = $data['postNewFriend'] ?? '';
296                 $this->knowYou       = $data['knowYou'] ?? false;
297                 $this->note          = $data['note'] ?? '';
298                 $this->request       = $data['request'] ?? '';
299                 $this->dfrnId        = $data['dfrn_id'] ?? -1;
300                 $this->addr          = $data['addr'] ?? '';
301                 $this->network       = $data['network'] ?? '';
302                 $this->uid           = $data['uid'] ?? -1;
303                 $this->keywords      = $data['keywords'] ?? '';
304                 $this->gender        = $data['gender'] ?? '';
305                 $this->location      = $data['location'] ?? '';
306                 $this->about         = $data['about'] ?? '';
307         }
308
309         /**
310          * @inheritDoc
311          */
312         public function jsonSerialize()
313         {
314                 return $this->toArray();
315         }
316
317         /**
318          * @return array
319          */
320         public function toArray()
321         {
322                 return get_object_vars($this);
323         }
324 }