]> git.mxchange.org Git - friendica.git/blob - src/Object/Notification/Introduction.php
Issue 10050: Improve photo deletions
[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 $location = '';
75         /** @var string */
76         private $about = '';
77
78         /**
79          * @return string
80          */
81         public function getLabel()
82         {
83                 return $this->label;
84         }
85
86         /**
87          * @return string
88          */
89         public function getType()
90         {
91                 return $this->type;
92         }
93
94         /**
95          * @return int
96          */
97         public function getIntroId()
98         {
99                 return $this->intro_id;
100         }
101
102         /**
103          * @return string
104          */
105         public function getMadeBy()
106         {
107                 return $this->madeBy;
108         }
109
110         /**
111          * @return string
112          */
113         public function getMadeByUrl()
114         {
115                 return $this->madeByUrl;
116         }
117
118         /**
119          * @return string
120          */
121         public function getMadeByZrl()
122         {
123                 return $this->madeByZrl;
124         }
125
126         /**
127          * @return string
128          */
129         public function getMadeByAddr()
130         {
131                 return $this->madeByAddr;
132         }
133
134         /**
135          * @return int
136          */
137         public function getContactId()
138         {
139                 return $this->contactId;
140         }
141
142         /**
143          * @return string
144          */
145         public function getPhoto()
146         {
147                 return $this->photo;
148         }
149
150         /**
151          * @return string
152          */
153         public function getName()
154         {
155                 return $this->name;
156         }
157
158         /**
159          * @return string
160          */
161         public function getUrl()
162         {
163                 return $this->url;
164         }
165
166         /**
167          * @return string
168          */
169         public function getZrl()
170         {
171                 return $this->zrl;
172         }
173
174         /**
175          * @return bool
176          */
177         public function isHidden()
178         {
179                 return $this->hidden;
180         }
181
182         /**
183          * @return int
184          */
185         public function getPostNewFriend()
186         {
187                 return $this->postNewFriend;
188         }
189
190         /**
191          * @return string
192          */
193         public function getKnowYou()
194         {
195                 return $this->knowYou;
196         }
197
198         /**
199          * @return string
200          */
201         public function getNote()
202         {
203                 return $this->note;
204         }
205
206         /**
207          * @return string
208          */
209         public function getRequest()
210         {
211                 return $this->request;
212         }
213
214         /**
215          * @return string
216          */
217         public function getDfrnId()
218         {
219                 return $this->dfrnId;
220         }
221
222         /**
223          * @return string
224          */
225         public function getAddr()
226         {
227                 return $this->addr;
228         }
229
230         /**
231          * @return string
232          */
233         public function getNetwork()
234         {
235                 return $this->network;
236         }
237
238         /**
239          * @return int
240          */
241         public function getUid()
242         {
243                 return $this->uid;
244         }
245
246         /**
247          * @return string
248          */
249         public function getKeywords()
250         {
251                 return $this->keywords;
252         }
253
254         /**
255          * @return string
256          */
257         public function getLocation()
258         {
259                 return $this->location;
260         }
261
262         /**
263          * @return string
264          */
265         public function getAbout()
266         {
267                 return $this->about;
268         }
269
270         public function __construct(array $data = [])
271         {
272                 $this->label         = $data['label'] ?? '';
273                 $this->type          = $data['str_type'] ?? '';
274                 $this->intro_id      = $data['intro_id'] ?? -1;
275                 $this->madeBy        = $data['madeBy'] ?? '';
276                 $this->madeByUrl     = $data['madeByUrl'] ?? '';
277                 $this->madeByZrl     = $data['madeByZrl'] ?? '';
278                 $this->madeByAddr    = $data['madeByAddr'] ?? '';
279                 $this->contactId     = $data['contactId'] ?? '';
280                 $this->photo         = $data['photo'] ?? '';
281                 $this->name          = $data['name'] ?? '';
282                 $this->url           = $data['url'] ?? '';
283                 $this->zrl           = $data['zrl'] ?? '';
284                 $this->hidden        = $data['hidden'] ?? false;
285                 $this->postNewFriend = $data['postNewFriend'] ?? '';
286                 $this->knowYou       = $data['knowYou'] ?? false;
287                 $this->note          = $data['note'] ?? '';
288                 $this->request       = $data['request'] ?? '';
289                 $this->dfrnId        = $data['dfrn_id'] ?? -1;
290                 $this->addr          = $data['addr'] ?? '';
291                 $this->network       = $data['network'] ?? '';
292                 $this->uid           = $data['uid'] ?? -1;
293                 $this->keywords      = $data['keywords'] ?? '';
294                 $this->location      = $data['location'] ?? '';
295                 $this->about         = $data['about'] ?? '';
296         }
297
298         /**
299          * @inheritDoc
300          */
301         public function jsonSerialize()
302         {
303                 return $this->toArray();
304         }
305
306         /**
307          * @return array
308          */
309         public function toArray()
310         {
311                 return get_object_vars($this);
312         }
313 }