oms-Kanban/Models/KanbanCardComment.php

145 lines
2.3 KiB
PHP
Executable File

<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Kanban\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Kanban\Models;
use Modules\Admin\Models\Account;
use Modules\Admin\Models\NullAccount;
/**
* Kanban card comment class.
*
* @package Modules\Kanban\Models
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
class KanbanCardComment implements \JsonSerializable
{
/**
* ID.
*
* @var int
* @since 1.0.0
*/
protected int $id = 0;
/**
* Description.
*
* @var string
* @since 1.0.0
*/
public string $description = '';
/**
* Description.
*
* @var string
* @since 1.0.0
*/
public string $descriptionRaw = '';
private int $card = 0;
public Account $createdBy;
public \DateTimeImmutable $createdAt;
private array $media = [];
/**
* Constructor.
*
* @since 1.0.0
*/
public function __construct()
{
$this->createdAt = new \DateTimeImmutable('now');
$this->createdBy = new NullAccount();
}
/**
* Get id.
*
* @return int Model id
*
* @since 1.0.0
*/
public function getId() : int
{
return $this->id;
}
/**
* Set the card
*
* @param int $id Card id
*
* @return void
*
* @since 1.0.0
*/
public function setCard(int $id) : void
{
$this->card = $id;
}
/**
* Get the card
*
* @return int
*
* @since 1.0.0
*/
public function getCard() : int
{
return $this->card;
}
/**
* Get the media files
*
* @return array
*
* @since 1.0.0
*/
public function getMedia() : array
{
return $this->media;
}
/**
* Add a media file
*
* @param mixed $media Media
*
* @return void
*
* @since 1.0.0
*/
public function addMedia($media) : void
{
$this->media[] = $media;
}
/**
* {@inheritdoc}
*/
public function jsonSerialize() : array
{
return [];
}
}