| @@ 91-107 (lines=17) @@ | ||
| 88 | return $this->getItems('projects', $data); |
|
| 89 | } |
|
| 90 | ||
| 91 | public function getRecentTimers() |
|
| 92 | { |
|
| 93 | $timers = []; |
|
| 94 | ||
| 95 | foreach ($this->timerAction('get_recent_timers', 'daily')['day_entries'] as $dayEntry) { |
|
| 96 | $timers[] = [ |
|
| 97 | 'id' => $dayEntry['id'], |
|
| 98 | 'description' => $dayEntry['notes'], |
|
| 99 | 'project_id' => $dayEntry['project_id'], |
|
| 100 | 'project_name' => $dayEntry['project'], |
|
| 101 | 'tags' => $dayEntry['task'], |
|
| 102 | 'duration' => $dayEntry['hours'] * 60 * 60, |
|
| 103 | ]; |
|
| 104 | } |
|
| 105 | ||
| 106 | return array_reverse($timers); |
|
| 107 | } |
|
| 108 | ||
| 109 | /** |
|
| 110 | * @param $data |
|
| @@ 113-129 (lines=17) @@ | ||
| 110 | /** |
|
| 111 | * @return mixed |
|
| 112 | */ |
|
| 113 | public function getRecentTimers() |
|
| 114 | { |
|
| 115 | $timers = []; |
|
| 116 | ||
| 117 | foreach ($this->timerAction('get_recent_timers', 'time_entries') as $timeEntry) { |
|
| 118 | $timers[] = [ |
|
| 119 | 'id' => $timeEntry['id'], |
|
| 120 | 'description' => $timeEntry['description'], |
|
| 121 | 'project_id' => $timeEntry['pid'], |
|
| 122 | 'project_name' => $timeEntry['pid'], |
|
| 123 | 'tags' => empty($timeEntry['tags']) ? '' : implode(', ', $timeEntry['tags']), |
|
| 124 | 'duration' => $timeEntry['duration'], |
|
| 125 | ]; |
|
| 126 | } |
|
| 127 | ||
| 128 | return array_reverse($timers); |
|
| 129 | } |
|
| 130 | ||
| 131 | /** |
|
| 132 | * @param $data |
|