diff --git a/Admin/Installer.php b/Admin/Installer.php index 6aae882..58493d7 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -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, diff --git a/Models/Task.php b/Models/Task.php index e785628..8e2db8e 100644 --- a/Models/Task.php +++ b/Models/Task.php @@ -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 + */ + public function getPriority() : int + { + return $this->priority; + } + + /** + * @param int $priority + * + * @throws InvalidEnumValue + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function setPriority(int $priority) + { + if(!TaskStatus::isValidValue($priority)) { + throw new InvalidEnumValue($priority); + } + + $this->priority = $priority; + } + /** * @return string * diff --git a/Models/TaskMapper.php b/Models/TaskMapper.php index 5fd5cb8..f33377f 100644 --- a/Models/TaskMapper.php +++ b/Models/TaskMapper.php @@ -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'],