3 * @copyright Copyright (C) 2020, Friendica
5 * @license GNU AGPL version 3 or any later version
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.
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.
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/>.
22 namespace Friendica\Object\Notification;
25 * A view-only object for printing item notifications to the frontend
27 class Notification implements \JsonSerializable
29 const SYSTEM = 'system';
30 const PERSONAL = 'personal';
31 const NETWORK = 'network';
32 const INTRO = 'intro';
50 private $seen = false;
55 public function getLabel()
63 public function getLink()
71 public function getImage()
79 public function getUrl()
87 public function getText()
95 public function getWhen()
103 public function getAgo()
111 public function isSeen()
116 public function __construct(array $data)
118 $this->label = $data['label'] ?? '';
119 $this->link = $data['link'] ?? '';
120 $this->image = $data['image'] ?? '';
121 $this->url = $data['url'] ?? '';
122 $this->text = $data['text'] ?? '';
123 $this->when = $data['when'] ?? '';
124 $this->ago = $data['ago'] ?? '';
125 $this->seen = $data['seen'] ?? false;
131 public function jsonSerialize()
133 return get_object_vars($this);
139 public function toArray()
141 return get_object_vars($this);