getSchedule array maximum size

Discussion for TimeTrex open source community developers.
Post Reply
queek
Posts: 2
Joined: Fri Apr 24, 2015 9:56 am

getSchedule array maximum size

Post by queek » Fri Apr 24, 2015 10:10 am

I can get into the API and retrieve the schedule information using getSchedule. The problem is that the array maxes out at 50 even though there are more than 50 records to return. Does anyone know how I can fix this or point me to where I can find this within the API to fix it myself?

My code:
$schedule_obj = new TimeTrexClientAPI( 'Schedule' );
$schedule_filter = array(
'filter_data' => array(
'start_date' => strtotime('20150426'),
'end_date' => strtotime('20150502')
)
);
$result = $schedule_obj->getSchedule($schedule_filter);
$schedule_data = $result->getResult();

Any help would be much appreciated.

shaunw
Posts: 7360
Joined: Tue Sep 19, 2006 2:22 pm

Re: getSchedule array maximum size

Post by shaunw » Fri Apr 24, 2015 11:28 am

Pass the 2nd argument to getSchedule() as TRUE, that disables paging and returns all results.

Code: Select all

$result = $schedule_obj->getSchedule($schedule_filter, TRUE );

queek
Posts: 2
Joined: Fri Apr 24, 2015 9:56 am

Re: getSchedule array maximum size

Post by queek » Fri Apr 24, 2015 12:30 pm

Thank you.

Post Reply