]> git.mxchange.org Git - friendica.git/blob - src/Navigation/Notifications/ValueObject/Introduction.php
Merge branch 'develop' into show_image_upload_limit
[friendica.git] / src / Navigation / Notifications / ValueObject / Introduction.php
1 <?php
2 /**
3  * @copyright Copyright (C) 2010-2022, the Friendica project
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\Navigation\Notifications\ValueObject;
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 int */
34         private $intro_id;
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 int */
44         private $contactId;
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;
55         /** @var int */
56         private $postNewFriend;
57         /** @var boolean */
58         private $knowYou;
59         /** @var string */
60         private $note;
61         /** @var string */
62         private $request;
63         /** @var int */
64         private $dfrnId;
65         /** @var string */
66         private $addr;
67         /** @var string */
68         private $network;
69         /** @var int */
70         private $uid;
71         /** @var string */
72         private $keywords;
73         /** @var string */
74         private $location;
75         /** @var string */
76         private $about;
77
78         public function getLabel(): string
79         {
80                 return $this->label;
81         }
82
83         public function getType(): string
84         {
85                 return $this->type;
86         }
87
88         public function getIntroId(): int
89         {
90                 return $this->intro_id;
91         }
92
93         public function getMadeBy(): string
94         {
95                 return $this->madeBy;
96         }
97
98         public function getMadeByUrl(): string
99         {
100                 return $this->madeByUrl;
101         }
102
103         public function getMadeByZrl(): string
104         {
105                 return $this->madeByZrl;
106         }
107
108         public function getMadeByAddr(): string
109         {
110                 return $this->madeByAddr;
111         }
112
113         public function getContactId(): int
114         {
115                 return $this->contactId;
116         }
117
118         public function getPhoto(): string
119         {
120                 return $this->photo;
121         }
122
123         public function getName(): string
124         {
125                 return $this->name;
126         }
127
128         public function getUrl(): string
129         {
130                 return $this->url;
131         }
132
133         public function getZrl(): string
134         {
135                 return $this->zrl;
136         }
137
138         public function isHidden(): bool
139         {
140                 return $this->hidden;
141         }
142
143         public function getPostNewFriend(): int
144         {
145                 return $this->postNewFriend;
146         }
147
148         public function getKnowYou(): string
149         {
150                 return $this->knowYou;
151         }
152
153         public function getNote(): string
154         {
155                 return $this->note;
156         }
157
158         public function getRequest(): string
159         {
160                 return $this->request;
161         }
162
163         public function getDfrnId(): int
164         {
165                 return $this->dfrnId;
166         }
167
168         public function getAddr(): string
169         {
170                 return $this->addr;
171         }
172
173         public function getNetwork(): string
174         {
175                 return $this->network;
176         }
177
178         public function getUid(): int
179         {
180                 return $this->uid;
181         }
182
183         public function getKeywords(): string
184         {
185                 return $this->keywords;
186         }
187
188         public function getLocation(): string
189         {
190                 return $this->location;
191         }
192
193         public function getAbout(): string
194         {
195                 return $this->about;
196         }
197
198         public function __construct(array $data = [])
199         {
200                 $this->label         = $data['label'] ?? '';
201                 $this->type          = $data['str_type'] ?? '';
202                 $this->intro_id      = $data['intro_id'] ?? -1;
203                 $this->madeBy        = $data['madeBy'] ?? '';
204                 $this->madeByUrl     = $data['madeByUrl'] ?? '';
205                 $this->madeByZrl     = $data['madeByZrl'] ?? '';
206                 $this->madeByAddr    = $data['madeByAddr'] ?? '';
207                 $this->contactId     = $data['contactId'] ?? -1;
208                 $this->photo         = $data['photo'] ?? '';
209                 $this->name          = $data['name'] ?? '';
210                 $this->url           = $data['url'] ?? '';
211                 $this->zrl           = $data['zrl'] ?? '';
212                 $this->hidden        = $data['hidden'] ?? false;
213                 $this->postNewFriend = $data['postNewFriend'] ?? '';
214                 $this->knowYou       = $data['knowYou'] ?? false;
215                 $this->note          = $data['note'] ?? '';
216                 $this->request       = $data['request'] ?? '';
217                 $this->dfrnId        = -1;
218                 $this->addr          = $data['addr'] ?? '';
219                 $this->network       = $data['network'] ?? '';
220                 $this->uid           = $data['uid'] ?? -1;
221                 $this->keywords      = $data['keywords'] ?? '';
222                 $this->location      = $data['location'] ?? '';
223                 $this->about         = $data['about'] ?? '';
224         }
225
226         /**
227          * @inheritDoc
228          */
229         public function jsonSerialize()
230         {
231                 return $this->toArray();
232         }
233
234         /**
235          * @return array
236          */
237         public function toArray(): array
238         {
239                 return get_object_vars($this);
240         }
241 }