oms-Workflow/Models/WorkflowInstanceAbstract.php

94 lines
1.5 KiB
PHP

<?php
/**
* Karaka
*
* PHP Version 8.0
*
* @package Modules\Workflow\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://karaka.app
*/
declare(strict_types=1);
namespace Modules\Workflow\Models;
use Modules\Admin\Models\Account;
use Modules\Admin\Models\NullAccount;
/**
* Workflow instance class.
*
* @package Modules\Workflow\Models
* @license OMS License 1.0
* @link https://karaka.app
* @since 1.0.0
*/
abstract class WorkflowInstanceAbstract
{
/**
* ID.
*
* @var int
* @since 1.0.0
*/
protected int $id = 0;
/**
* Title.
*
* @var string
* @since 1.0.0
*/
public string $title = '';
/**
* Template.
*
* @var WorkflowTemplate
* @since 1.0.0
*/
public WorkflowTemplate $template;
/**
* Creator.
*
* @var Account
* @since 1.0.0
*/
public Account $createdBy;
/**
* Created.
*
* @var \DateTimeImmutable
* @since 1.0.0
*/
public \DateTimeImmutable $createdAt;
/**
* Constructor.
*
* @since 1.0.0
*/
public function __construct()
{
$this->template = new NullWorkflowTemplate();
$this->createdBy = new NullAccount();
$this->createdAt = new \DateTimeImmutable('now');
}
/**
* Get id
*
* @return int
*
* @since 1.0.0
*/
public function getId() : int
{
return $this->id;
}
}