3 * @copyright Copyright (C) 2010-2022, the Friendica project
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\Navigation\Notifications\Entity;
25 use Friendica\BaseEntity;
30 * @property-read $verb
31 * @property-read $type
32 * @property-read $actorId
33 * @property-read $targetUriId
34 * @property-read $parentUriId
35 * @property-read $created
36 * @property-read $seen
37 * @property-read $dismissed
39 class Notification extends BaseEntity
48 * @var int One of the \Friendica\Model\Post\UserNotification::TYPE_* constant values
49 * @see \Friendica\Model\Post\UserNotification
55 protected $targetUriId;
57 protected $parentUriId;
66 * Please do not use this constructor directly, instead use one of the method of the Notification factory.
72 * @param int|null $targetUriId
73 * @param int|null $parentUriId
74 * @param DateTime|null $created
76 * @param bool $dismissed
78 * @see \Friendica\Navigation\Notifications\Factory\Notification
80 public function __construct(int $uid, string $verb, int $type, int $actorId, int $targetUriId = null, int $parentUriId = null, DateTime $created = null, bool $seen = false, bool $dismissed = false, int $id = null)
85 $this->actorId = $actorId;
86 $this->targetUriId = $targetUriId;
87 $this->parentUriId = $parentUriId ?: $targetUriId;
88 $this->created = $created;
90 $this->dismissed = $dismissed;
95 public function setSeen()
100 public function setDismissed()
102 $this->dismissed = true;