mirror of
https://github.com/Karaka-Management/oms-Tasks.git
synced 2026-01-27 06:28:39 +00:00
Fixes #40
This commit is contained in:
parent
b14ffd73d5
commit
33cf30850a
|
|
@ -53,6 +53,7 @@ class Installer extends InstallerAbstract
|
|||
`task_desc` text NOT NULL,
|
||||
`task_type` tinyint(1) NOT NULL,
|
||||
`task_status` tinyint(1) NOT NULL,
|
||||
`task_priority` tinyint(1) NOT NULL,
|
||||
`task_due` datetime NOT NULL,
|
||||
`task_done` datetime DEFAULT NULL,
|
||||
`task_schedule` int(11) DEFAULT NULL,
|
||||
|
|
|
|||
|
|
@ -120,6 +120,8 @@ class Task implements \JsonSerializable
|
|||
*/
|
||||
protected $schedule = null;
|
||||
|
||||
protected $priority = TaskPriority::MEDIUM;
|
||||
|
||||
protected $media = [];
|
||||
|
||||
/**
|
||||
|
|
@ -307,6 +309,34 @@ class Task implements \JsonSerializable
|
|||
$this->status = $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getPriority() : int
|
||||
{
|
||||
return $this->priority;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $priority
|
||||
*
|
||||
* @throws InvalidEnumValue
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setPriority(int $priority)
|
||||
{
|
||||
if(!TaskStatus::isValidValue($priority)) {
|
||||
throw new InvalidEnumValue($priority);
|
||||
}
|
||||
|
||||
$this->priority = $priority;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ class TaskMapper extends DataMapperAbstract
|
|||
'task_desc' => ['name' => 'task_desc', 'type' => 'string', 'internal' => 'description'],
|
||||
'task_type' => ['name' => 'task_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'task_status' => ['name' => 'task_status', 'type' => 'int', 'internal' => 'status'],
|
||||
'task_priority' => ['name' => 'task_priority', 'type' => 'int', 'internal' => 'priority'],
|
||||
'task_due' => ['name' => 'task_due', 'type' => 'DateTime', 'internal' => 'due'],
|
||||
'task_done' => ['name' => 'task_done', 'type' => 'DateTime', 'internal' => 'done'],
|
||||
'task_schedule' => ['name' => 'task_schedule', 'type' => 'int', 'internal' => 'schedule'],
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user