From 4f325193be4f16a9658258fecd525e71917156a0 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 26 Feb 2017 16:06:09 -0500 Subject: Add class SubtaskListFormatter --- app/Formatter/SubtaskListFormatter.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 app/Formatter/SubtaskListFormatter.php (limited to 'app/Formatter') diff --git a/app/Formatter/SubtaskListFormatter.php b/app/Formatter/SubtaskListFormatter.php new file mode 100644 index 00000000..5b20111d --- /dev/null +++ b/app/Formatter/SubtaskListFormatter.php @@ -0,0 +1,34 @@ +subtaskModel->getStatusList(); + $subtasks = $this->query->findAll(); + + foreach ($subtasks as &$subtask) { + $subtask['status_name'] = $status[$subtask['status']]; + $subtask['timer_start_date'] = isset($subtask['timer_start_date']) ? $subtask['timer_start_date'] : 0; + $subtask['is_timer_started'] = ! empty($subtask['timer_start_date']); + } + + return $subtasks; + } +} -- cgit v1.2.3