3 * @copyright Copyright (C) 2010-2023, 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\Object\Api\Mastodon\Status;
24 use Friendica\BaseDataTransferObject;
25 use Friendica\Util\DateTimeFormat;
28 * Class FriendicaExtension
30 * Additional fields on Mastodon Statuses for storing Friendica specific data
32 * @see https://docs.joinmastodon.org/entities/status
34 class FriendicaExtension extends BaseDataTransferObject
39 /** @var string|null (Datetime) */
40 protected $changed_at;
42 /** @var string|null (Datetime) */
43 protected $commented_at;
45 /** @var string|null (Datetime) */
46 protected $received_at;
48 /** @var FriendicaDeliveryData */
49 protected $delivery_data;
51 protected $dislikes_count;
55 * Creates a status count object
57 * @param string $title
58 * @param string|null $changed_at
59 * @param string|null $commented_at
60 * @param string|null $edited_at
61 * @param string|null $received_at
62 * @param int $dislikes_count
63 * @param FriendicaDeliveryData $delivery_data
65 public function __construct(
68 ?string $commented_at,
71 FriendicaDeliveryData $delivery_data
73 $this->title = $title;
74 $this->changed_at = $changed_at ? DateTimeFormat::utc($changed_at, DateTimeFormat::JSON) : null;
75 $this->commented_at = $commented_at ? DateTimeFormat::utc($commented_at, DateTimeFormat::JSON) : null;
76 $this->received_at = $received_at ? DateTimeFormat::utc($received_at, DateTimeFormat::JSON) : null;
77 $this->delivery_data = $delivery_data;
78 $this->dislikes_count = $dislikes_count;
82 * Returns the current changed_at string or null if not set
85 public function changedAt(): ?string
87 return $this->changed_at;
91 * Returns the current commented_at string or null if not set
94 public function commentedAt(): ?string
96 return $this->commented_at;
100 * Returns the current received_at string or null if not set
103 public function receivedAt(): ?string
105 return $this->received_at;