From e693b8bba108d7be9c7fdf00b6a1eb1c258d66a4 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 5 Oct 2017 19:15:49 +0200 Subject: [PATCH] Fix #110 --- Admin/Installer.php | 1 + Models/Task.php | 12 ++++++++++++ Models/TaskMapper.php | 1 + 3 files changed, 14 insertions(+) diff --git a/Admin/Installer.php b/Admin/Installer.php index ced1f88..2c11e1c 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -49,6 +49,7 @@ class Installer extends InstallerAbstract `task_desc` text NOT NULL, `task_type` tinyint(1) NOT NULL, `task_status` tinyint(1) NOT NULL, + `task_closable` tinyint(1) NOT NULL, `task_priority` tinyint(1) NOT NULL, `task_due` datetime NOT NULL, `task_done` datetime DEFAULT NULL, diff --git a/Models/Task.php b/Models/Task.php index bc99062..764404f 100644 --- a/Models/Task.php +++ b/Models/Task.php @@ -84,6 +84,8 @@ class Task implements \JsonSerializable */ protected $status = TaskStatus::OPEN; + protected $isClosable = true; + /** * Due. * @@ -133,6 +135,16 @@ class Task implements \JsonSerializable $this->schedule = new Schedule(); } + public function setClosable(bool $closable) /* : void */ + { + $this->isClosable = $closabe; + } + + public function isClosable() : bool + { + return $this->isClosable; + } + /** * Adding new task element. * diff --git a/Models/TaskMapper.php b/Models/TaskMapper.php index 2f6d732..5c03372 100644 --- a/Models/TaskMapper.php +++ b/Models/TaskMapper.php @@ -47,6 +47,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_closable' => ['name' => 'task_closable', 'type' => 'bool', 'internal' => 'isClosable'], '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'],