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
38 class Notification extends BaseEntity
47 * @var int One of the \Friendica\Model\Post\UserNotification::TYPE_* constant values
48 * @see \Friendica\Model\Post\UserNotification
54 protected $targetUriId;
56 protected $parentUriId;
65 * Please do not use this constructor directly, instead use one of the method of the Notification factory.
71 * @param int|null $targetUriId
72 * @param int|null $parentUriId
73 * @param DateTime|null $created
76 * @param bool $dismissed
77 * @see \Friendica\Navigation\Notifications\Factory\Notification
79 public function __construct(int $uid, string $verb, int $type, int $actorId, int $targetUriId = null, int $parentUriId = null, DateTime $created = null, bool $seen = false, int $id = null, bool $dismissed = false)
84 $this->actorId = $actorId;
85 $this->targetUriId = $targetUriId;
86 $this->parentUriId = $parentUriId ?: $targetUriId;
87 $this->created = $created;
90 $this->dismissed = $dismissed;
93 public function setSeen()
98 public function setDismissed()
100 $this->dismissed = true;