mirror of
https://github.com/Karaka-Management/oms-Kanban.git
synced 2026-01-11 11:28:42 +00:00
200 lines
3.2 KiB
PHP
Executable File
200 lines
3.2 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* Orange Management
|
|
*
|
|
* PHP Version 7.4
|
|
*
|
|
* @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;
|
|
|
|
/**
|
|
* Task 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
|
|
*/
|
|
private string $description = '';
|
|
|
|
private $card = 0;
|
|
|
|
private Account $createdBy;
|
|
|
|
private \DateTime $createdAt;
|
|
|
|
private array $media = [];
|
|
|
|
/**
|
|
* Constructor.
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->createdAt = new \DateTime('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 description
|
|
*
|
|
* @return string
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function getDescription() : string
|
|
{
|
|
return $this->description;
|
|
}
|
|
|
|
/**
|
|
* Set description
|
|
*
|
|
* @param string $description Description
|
|
*
|
|
* @return void
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function setDescription(string $description) : void
|
|
{
|
|
$this->description = $description;
|
|
}
|
|
|
|
/**
|
|
* Get created by
|
|
*
|
|
* @return Account
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function getCreatedBy() : Account
|
|
{
|
|
return $this->createdBy;
|
|
}
|
|
|
|
/**
|
|
* Set created by
|
|
*
|
|
* @param Account $account Created by
|
|
*
|
|
* @return void
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function setCreatedBy(Account $account) : void
|
|
{
|
|
$this->createdBy = $account;
|
|
}
|
|
|
|
/**
|
|
* Get created at date time
|
|
*
|
|
* @return \DateTime
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function getCreatedAt() : \DateTime
|
|
{
|
|
return $this->createdAt;
|
|
}
|
|
|
|
/**
|
|
* 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 [];
|
|
}
|
|
}
|