mirror of
https://github.com/Karaka-Management/oms-Knowledgebase.git
synced 2026-01-12 09:58:41 +00:00
200 lines
3.2 KiB
PHP
200 lines
3.2 KiB
PHP
<?php
|
|
/**
|
|
* Orange Management
|
|
*
|
|
* PHP Version 7.4
|
|
*
|
|
* @package Modules\Knowledgebase\Models
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 1.0
|
|
* @version 1.0.0
|
|
* @link https://orange-management.org
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace Modules\Knowledgebase\Models;
|
|
|
|
/**
|
|
* Task class.
|
|
*
|
|
* @package Modules\Knowledgebase\Models
|
|
* @license OMS License 1.0
|
|
* @link https://orange-management.org
|
|
* @since 1.0.0
|
|
*/
|
|
class WikiDoc implements \JsonSerializable
|
|
{
|
|
/**
|
|
* ID.
|
|
*
|
|
* @var int
|
|
* @since 1.0.0
|
|
*/
|
|
protected int $id = 0;
|
|
/**
|
|
* Name.
|
|
*
|
|
* @var string
|
|
* @since 1.0.0
|
|
*/
|
|
private string $name = '';
|
|
|
|
private int $status = WikiStatus::ACTIVE;
|
|
|
|
private $doc = '';
|
|
|
|
private $category = 0;
|
|
|
|
private $language = '';
|
|
|
|
private $createdBy = 0;
|
|
|
|
private $createdAt = null;
|
|
|
|
private $badges = [];
|
|
|
|
/**
|
|
* Constructor.
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->createdAt = new \DateTime('now');
|
|
}
|
|
|
|
/**
|
|
* Get id.
|
|
*
|
|
* @return int Model id
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function getId() : int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getLanguage() : string
|
|
{
|
|
return $this->language;
|
|
}
|
|
|
|
public function setLanguage(string $language) : void
|
|
{
|
|
$this->language = $language;
|
|
}
|
|
|
|
/**
|
|
* Get name
|
|
*
|
|
* @return string
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function getName() : string
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
/**
|
|
* Set name
|
|
*
|
|
* @param string $name Name
|
|
*
|
|
* @return void
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function setName(string $name) : void
|
|
{
|
|
$this->name = $name;
|
|
}
|
|
|
|
public function getDoc() : string
|
|
{
|
|
return $this->doc;
|
|
}
|
|
|
|
public function setDoc(string $doc) : void
|
|
{
|
|
$this->doc = $doc;
|
|
}
|
|
|
|
public function getStatus() : int
|
|
{
|
|
return $this->status;
|
|
}
|
|
|
|
public function setStatus(int $status) : void
|
|
{
|
|
$this->status = $status;
|
|
}
|
|
|
|
public function getCategory()
|
|
{
|
|
return $this->category;
|
|
}
|
|
|
|
public function setCategory(int $category) : void
|
|
{
|
|
$this->category = $category;
|
|
}
|
|
|
|
/**
|
|
* Get created by
|
|
*
|
|
* @return int|\phpOMS\Account\Account
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function getCreatedBy() : int
|
|
{
|
|
return $this->createdBy;
|
|
}
|
|
|
|
/**
|
|
* Set created by
|
|
*
|
|
* @param mixed $id Created by
|
|
*
|
|
* @return void
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function setCreatedBy($id) : void
|
|
{
|
|
$this->createdBy = $id;
|
|
}
|
|
|
|
/**
|
|
* Get created at date time
|
|
*
|
|
* @return \DateTime
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function getCreatedAt() : \DateTime
|
|
{
|
|
return $this->createdAt;
|
|
}
|
|
|
|
public function getBadges() : array
|
|
{
|
|
return $this->badges;
|
|
}
|
|
|
|
public function addBadge($badge) : void
|
|
{
|
|
$this->badges[] = $badge;
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function jsonSerialize() : array
|
|
{
|
|
return [];
|
|
}
|
|
}
|