File size: 844 Bytes
e4f4821 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
<?php
namespace Kanboard\Formatter;
use Kanboard\Core\Filter\FormatterInterface;
/**
* Class SubtaskListFormatter
*
* @package Kanboard\Formatter
* @author Frederic Guillot
*/
class SubtaskListFormatter extends BaseFormatter implements FormatterInterface
{
/**
* Apply formatter
*
* @access public
* @return array
*/
public function format()
{
$status = $this->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;
}
}
|