@@ 61-77 (lines=17) @@ | ||
58 | return $this->getItems('projects', $data); |
|
59 | } |
|
60 | ||
61 | public function getRecentTimers() |
|
62 | { |
|
63 | $timers = []; |
|
64 | ||
65 | foreach ($this->timerAction('get_recent_timers', 'daily')['day_entries'] as $dayEntry) { |
|
66 | $timers[] = [ |
|
67 | 'id' => $dayEntry['id'], |
|
68 | 'description' => $dayEntry['notes'], |
|
69 | 'project_id' => $dayEntry['project_id'], |
|
70 | 'project_name' => $dayEntry['project'], |
|
71 | 'tags' => $dayEntry['task'], |
|
72 | 'duration' => $dayEntry['hours'] * 60 * 60, |
|
73 | ]; |
|
74 | } |
|
75 | ||
76 | return array_reverse($timers); |
|
77 | } |
|
78 | ||
79 | /** |
|
80 | * @param $data |
@@ 78-94 (lines=17) @@ | ||
75 | /** |
|
76 | * @return mixed |
|
77 | */ |
|
78 | public function getRecentTimers() |
|
79 | { |
|
80 | $timers = []; |
|
81 | ||
82 | foreach ($this->timerAction('get_recent_timers', 'time_entries') as $timeEntry) { |
|
83 | $timers[] = [ |
|
84 | 'id' => $timeEntry['id'], |
|
85 | 'description' => $timeEntry['description'], |
|
86 | 'project_id' => $timeEntry['pid'], |
|
87 | 'project_name' => $timeEntry['pid'], |
|
88 | 'tags' => empty($timeEntry['tags']) ? '' : implode(', ', $timeEntry['tags']), |
|
89 | 'duration' => $timeEntry['duration'], |
|
90 | ]; |
|
91 | } |
|
92 | ||
93 | return array_reverse($timers); |
|
94 | } |
|
95 | ||
96 | /** |
|
97 | * @param $data |