This commit is contained in:
Dennis Eichhorn 2017-03-31 15:26:33 +02:00
parent b14ffd73d5
commit 33cf30850a
3 changed files with 32 additions and 0 deletions

View File

@ -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,

View File

@ -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
*

View File

@ -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'],