@@ -92,9 +92,11 @@ <h4>Methods</h4>
9292 < a style ="font-style: italic; " href ="#Collection::GetHttpRequestObject() "> GetHttpRequestObject</ a > ,
9393 < a style ="font-style: italic; " href ="#Collection::MakeQueryString() "> MakeQueryString</ a > ,
9494 < a style ="font-style: italic; " href ="#Collection::Next() "> Next</ a > ,
95+ < a style ="font-style: italic; " href ="#Collection::NextPage() "> NextPage</ a > ,
9596 < a style ="font-style: italic; " href ="#Collection::Reset() "> Reset</ a > ,
9697 < a style ="font-style: italic; " href ="#Collection::Select() "> Select</ a > ,
9798 < a style ="font-style: italic; " href ="#Collection::Service() "> Service</ a > ,
99+ < a style ="font-style: italic; " href ="#Collection::SetNextPageCallback() "> SetNextPageCallback</ a > ,
98100 < a style ="font-style: italic; " href ="#Collection::SetProperty() "> SetProperty</ a > ,
99101 < a style ="font-style: italic; " href ="#Collection::Size() "> Size</ a > ,
100102 < a style ="font-style: italic; " href ="#Collection::Sort() "> Sort</ a > ,
@@ -220,8 +222,8 @@ <h4>Tags</h4>
220222 < span class ="nb-faded-text "> \OpenCloud\Base</ span >
221223</ h3 >
222224< h4 > Description</ h4 >
223- < em > Resets the collection pointer back to the first item in the set
224- and returns it</ em > < br > < small > < p > This is useful if you're only interested in the first item in the set .</ p > </ small > < br > < h4 > Return value</ h4 >
225+ < em > Resets the collection pointer back to the first item in the page
226+ and returns it</ em > < br > < small > < p > This is useful if you're only interested in the first item in the page .</ p > </ small > < br > < h4 > Return value</ h4 >
225227< table >
226228< thead > < tr >
227229< th > Type</ th >
@@ -366,15 +368,57 @@ <h4>Tags</h4>
366368 < span class ="nb-faded-text "> \OpenCloud\Base</ span >
367369</ h3 >
368370< h4 > Description</ h4 >
369- < em > Returns the next item in the set </ em > < br > < h4 > Return value</ h4 >
371+ < em > Returns the next item in the page </ em > < br > < h4 > Return value</ h4 >
370372< table >
371373< thead > < tr >
372374< th > Type</ th >
373375< th > Description</ th >
374376</ tr > </ thead >
375377< tbody > < tr >
376378< td > \OpenCloud\Base</ td >
377- < td > the next item or FALSE if at the end of the set</ td >
379+ < td > the next item or FALSE if at the end of the page</ td >
380+ </ tr > </ tbody >
381+ </ table >
382+ < h4 > Tags</ h4 >
383+ < table >
384+ < thead > < tr >
385+ < th > Name</ th >
386+ < th > Description</ th >
387+ </ tr > </ thead >
388+ < tbody > < tr >
389+ < td > api</ td >
390+ < td > </ td >
391+ </ tr > </ tbody >
392+ </ table >
393+ </ div >
394+ < div class ="method ">
395+ < a id ="Collection::NextPage() "> </ a > < h3 > NextPage< span class ="nb-faded-text "> (
396+
397+ )
398+ </ span >
399+ :
400+ < span class ="nb-faded-text "> \OpenCloud\Collection</ span >
401+ </ h3 >
402+ < h4 > Description</ h4 >
403+ < em > returns the Collection object for the next page of results, or
404+ FALSE if there are no more pages</ em > < br > < small > < p > Generally, the structure for a multi-page collection will look like
405+ this:</ p >
406+
407+ < pre > < code > $coll = $obj->Collection();
408+ do {
409+ while($item = $coll->Next()) {
410+ // do something with the item
411+ |
412+ } while ($coll = $coll->NextPage());
413+ </ code > </ pre > </ small > < br > < h4 > Return value</ h4 >
414+ < table >
415+ < thead > < tr >
416+ < th > Type</ th >
417+ < th > Description</ th >
418+ </ tr > </ thead >
419+ < tbody > < tr >
420+ < td > \OpenCloud\Collection</ td >
421+ < td > if there are more pages of results, otherwise FALSE</ td >
378422</ tr > </ tbody >
379423</ table >
380424< h4 > Tags</ h4 >
@@ -528,6 +572,64 @@ <h4>Description</h4>
528572</ table >
529573</ div >
530574< div class ="method ">
575+ < a id ="Collection::SetNextPageCallback() "> </ a > < h3 > SetNextPageCallback< span class ="nb-faded-text "> (
576+ callable
577+
578+ $callback,
579+ string
580+
581+ $url,
582+
583+ )
584+ </ span >
585+ :
586+ < span class ="nb-faded-text "> void</ span >
587+ </ h3 >
588+ < h4 > Description</ h4 >
589+ < em > for paginated collection, sets the callback function and URL for
590+ the next page</ em > < br > < small > < p > The callback function should have the signature:</ p >
591+
592+ < pre > < code > function Whatever($class, $url, $parent)
593+ </ code > </ pre >
594+
595+ < p > and the < code > $url</ code > should be the URL of the next page of results</ p > </ small > < br > < h4 > Arguments</ h4 >
596+ < table >
597+ < thead > < tr >
598+ < th > Name</ th >
599+ < th > Type</ th >
600+ < th > Description</ th >
601+ < th > Default</ th >
602+ </ tr > </ thead >
603+ < tbody >
604+ < tr >
605+ < td > $callback</ td >
606+ < td style ="white-space: normal; "> callable</ td >
607+ < td > < p > the name of the function (or array of
608+ object, function name)</ p >
609+ </ td >
610+ < td > </ td >
611+ </ tr >
612+ < tr >
613+ < td > $url</ td >
614+ < td style ="white-space: normal; "> string</ td >
615+ < td > < p > the URL of the next page of results</ p > </ td >
616+ < td > </ td >
617+ </ tr >
618+ </ tbody >
619+ </ table >
620+ < h4 > Return value</ h4 >
621+ < table >
622+ < thead > < tr >
623+ < th > Type</ th >
624+ < th > Description</ th >
625+ </ tr > </ thead >
626+ < tbody > < tr >
627+ < td > void</ td >
628+ < td > </ td >
629+ </ tr > </ tbody >
630+ </ table >
631+ </ div >
632+ < div class ="method ">
531633< a id ="Collection::SetProperty() "> </ a > < h3 > SetProperty< span class ="nb-faded-text "> (
532634 string
533635
@@ -616,7 +718,9 @@ <h4>Tags</h4>
616718 < span class ="nb-faded-text "> integer</ span >
617719</ h3 >
618720< h4 > Description</ h4 >
619- < em > Returns the number of items in the collection</ em > < br > < h4 > Return value</ h4 >
721+ < em > Returns the number of items in the page</ em > < br > < small > < p > For most services, this is the total number of items. If the Collection
722+ is paginated, however, this only returns the count of items in the
723+ current page of data.</ p > </ small > < br > < h4 > Return value</ h4 >
620724< table >
621725< thead > < tr >
622726< th > Type</ th >
@@ -652,7 +756,9 @@ <h4>Tags</h4>
652756 < span class ="nb-faded-text "> void</ span >
653757</ h3 >
654758< h4 > Description</ h4 >
655- < em > sorts the collection on a specified key</ em > < br > < small > < p > Note: only top-level keys can be used as the sort key</ p > </ small > < br > < h4 > Arguments</ h4 >
759+ < em > sorts the collection on a specified key</ em > < br > < small > < p > Note: only top-level keys can be used as the sort key. Note that this
760+ only sorts the data in the current page of the Collection (for
761+ multi-page data).</ p > </ small > < br > < h4 > Arguments</ h4 >
656762< table >
657763< thead > < tr >
658764< th > Name</ th >
@@ -1084,6 +1190,9 @@ <h4>Properties</h4>
10841190 < a href ="#Collection::%24http_headers "> $http_headers</ a > ,
10851191 < a href ="#Collection::%24itemclass "> $itemclass</ a > ,
10861192 < a href ="#Collection::%24itemlist "> $itemlist</ a > ,
1193+ < a href ="#Collection::%24next_page_callback "> $next_page_callback</ a > ,
1194+ < a href ="#Collection::%24next_page_class "> $next_page_class</ a > ,
1195+ < a href ="#Collection::%24next_page_url "> $next_page_url</ a > ,
10871196 < a href ="#Collection::%24pointer "> $pointer</ a > ,
10881197 < a href ="#Collection::%24service "> $service</ a > ,
10891198 < a href ="#Collection::%24sortkey "> $sortkey</ a > ,
@@ -1124,6 +1233,33 @@ <h4>Properties</h4>
11241233< em > </ em > < br >
11251234</ div >
11261235< div class ="method ">
1236+ < a id ="Collection::$next_page_callback "> </ a > < h3 >
1237+ < span class ="nb-faded-text ">
1238+ private
1239+ </ span > $next_page_callback
1240+ =
1241+ </ h3 >
1242+ < em > </ em > < br >
1243+ </ div >
1244+ < div class ="method ">
1245+ < a id ="Collection::$next_page_class "> </ a > < h3 >
1246+ < span class ="nb-faded-text ">
1247+ private
1248+ </ span > $next_page_class
1249+ =
1250+ </ h3 >
1251+ < em > </ em > < br >
1252+ </ div >
1253+ < div class ="method ">
1254+ < a id ="Collection::$next_page_url "> </ a > < h3 >
1255+ < span class ="nb-faded-text ">
1256+ private
1257+ </ span > $next_page_url
1258+ =
1259+ </ h3 >
1260+ < em > </ em > < br >
1261+ </ div >
1262+ < div class ="method ">
11271263< a id ="Collection::$pointer "> </ a > < h3 >
11281264< span class ="nb-faded-text ">
11291265 private
0 commit comments