column->getList($task['project_id']); $sums = $this->transition->getTimeSpentByTask($task['id']); foreach ($columns as $column_id => $column_title) { $time_spent = isset($sums[$column_id]) ? $sums[$column_id] : 0; if ($task['column_id'] == $column_id) { $time_spent += ($task['date_completed'] ?: time()) - $task['date_moved']; } $result[] = array( 'id' => $column_id, 'title' => $column_title, 'time_spent' => $time_spent, ); } return $result; } }