oms-OnlineResourceWatcher/Models/Report.php
2023-06-17 03:13:30 +02:00

85 lines
1.5 KiB
PHP
Executable File

<?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package Modules\OnlineResourceWatcher\Models
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\OnlineResourceWatcher\Models;
/**
* Report class.
*
* @package Modules\OnlineResourceWatcher\Models
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
class Report implements \JsonSerializable
{
/**
* ID.
*
* @var int
* @since 1.0.0
*/
public int $id = 0;
/**
* Created.
*
* @var \DateTimeImmutable
* @since 1.0.0
*/
public \DateTimeImmutable $createdAt;
public int $resource = 0;
public string $versionPath = '';
public int $changeMetric = 0;
public int $status = ReportStatus::NO_CHANGE;
public string $change = '';
/**
* Constructor.
*
* @since 1.0.0
*/
public function __construct()
{
$this->createdAt = new \DateTimeImmutable('now');
}
/**
* {@inheritdoc}
*/
public function toArray() : array
{
return [
'id' => $this->id,
'createdAt' => $this->createdAt,
'resource' => $this->resource,
'status' => $this->status,
'changemetric' => $this->changeMetric,
];
}
/**
* {@inheritdoc}
*/
public function jsonSerialize() : mixed
{
return $this->toArray();
}
}