]> git.mxchange.org Git - friendica.git/blob - src/Object/Api/Mastodon/Status/FriendicaExtension.php
Fix calendar attendance icons
[friendica.git] / src / Object / Api / Mastodon / Status / FriendicaExtension.php
1 <?php
2 /**
3  * @copyright Copyright (C) 2010-2023, 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\Object\Api\Mastodon\Status;
23
24 use Friendica\BaseDataTransferObject;
25
26 /**
27  * Class FriendicaExtension
28  *
29  * Additional fields on Mastodon Statuses for storing Friendica specific data
30  *
31  * @see https://docs.joinmastodon.org/entities/status
32  */
33 class FriendicaExtension extends BaseDataTransferObject
34 {
35         /** @var string */
36         protected $title;
37
38         /** @var string|null (Datetime) */
39         protected $changed_at;
40
41         /** @var string|null (Datetime) */
42         protected $commented_at;
43
44         /** @var string|null (Datetime) */
45         protected $received_at;
46
47         /** @var FriendicaDeliveryData */
48         protected $delivery_data;
49         /** @var int */
50         protected $dislikes_count;
51
52
53         /**
54          * Creates a status count object
55          *
56          * @param string $title
57          * @param string|null $changed_at
58          * @param string|null $commented_at
59          * @param string|null $edited_at
60          * @param string|null $received_at
61          * @param int $dislikes_count
62          * @param FriendicaDeliveryData $delivery_data
63          */
64         public function __construct(
65                 string $title,
66                 ?string $changed_at,
67                 ?string $commented_at,
68                 ?string $received_at,
69                 int $dislikes_count,
70                 FriendicaDeliveryData $delivery_data
71         ) {
72                 $this->title          = $title;
73                 $this->changed_at     = $changed_at;
74                 $this->commented_at   = $commented_at;
75                 $this->received_at    = $received_at;
76                 $this->delivery_data  = $delivery_data;
77                 $this->dislikes_count = $dislikes_count;
78         }
79
80         /**
81          * Returns the current changed_at string or null if not set
82          * @return ?string
83          */
84         public function changedAt(): ?string
85         {
86                 return $this->changed_at;
87         }
88
89         /**
90          * Returns the current commented_at string or null if not set
91          * @return ?string
92          */
93         public function commentedAt(): ?string
94         {
95                 return $this->commented_at;
96         }
97
98         /**
99          * Returns the current received_at string or null if not set
100          * @return ?string
101          */
102         public function receivedAt(): ?string
103         {
104                 return $this->received_at;
105         }
106 }