public function timeEntry($client, $issueId) { $timeEntries = $client->api('time_entry')->all(array('issue_id' => $issueId, 'limit' => 10000)); try { $timeEntry = new TimeEntry(); foreach ($timeEntries['time_entries'] as $key => $entry) { $timeEntry->exchangeArray($entry); $this->getTimeEntryTable()->saveTimeEntry($timeEntry); } } catch (\Exception $ex) { //send mail if any error occur during CRON JOB } }
public function timeEntry() { $issueId = 54293; $client = new Client("https://portal.optimusinfo.com/redmine/", 'vikas.singhal', 'vzi950'); $timeEntries = $client->api('time_entry')->all(array('issue_id' => $issueId)); //echo "<pre>";print_r($timeEntries);die; $timeEntry = new TimeEntry(); foreach ($timeEntries['time_entries'] as $key => $entry) { $timeEntry->exchangeArray($entry); $this->getTimeEntryTable()->saveTimeEntry($timeEntry); } return true; }