/** * get a user's active time entry * * <code> * $api = new HarvestReports(); * * $result = $api->getUsersActiveTimer( 12345 ); * if ( $result->isSuccess() ) { * $activeTimer = $result->data; * } * </code> * * @return Result */ public function getUsersActiveTimer($user_id) { $result = $this->getUserEntries($user_id, Range::today($this->_timeZone)); if ($result->isSuccess()) { $data = null; foreach ($result->data as $entry) { if ($entry->timer_started_at != null || $entry->timer_started_at != "") { $data = $entry; break; } } $result->data = $data; } return $result; }