spreed/lib/Model/Consent.php
Joas Schilling c8c21215af
fix: Add Override atttribute
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-03-25 21:09:46 +01:00

46 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Talk\Model;
use OCP\AppFramework\Db\Entity;
use OCP\DB\Types;
/**
* @method void setToken(string $token)
* @method string getToken()
* @method void setActorType(string $actorType)
* @method string getActorType()
* @method void setActorId(string $actorId)
* @method string getActorId()
* @method void setDateTime(\DateTime $dateTime)
* @method \DateTime getDateTime()
*/
class Consent extends Entity implements \JsonSerializable {
protected string $token = '';
protected string $actorType = '';
protected string $actorId = '';
protected ?\DateTime $dateTime = null;
public function __construct() {
$this->addType('token', Types::STRING);
$this->addType('actorType', Types::STRING);
$this->addType('actorId', Types::STRING);
$this->addType('dateTime', Types::DATETIME);
}
#[\Override]
public function jsonSerialize(): array {
return [
'token' => $this->getToken(),
'actorType' => $this->getActorType(),
'actorId' => $this->getActorId(),
'timestamp' => $this->getDateTime()->getTimestamp(),
];
}
}