Class PaginatedIterator
Class ResourceIterator is tasked with iterating over resource collections - many of which are paginated. Based on a base URL, the iterator will append elements based on further requests to the API. Each time this happens, query parameters (marker) are updated based on the current value.
- OpenCloud\Common\ArrayAccess implements ArrayAccess
-
OpenCloud\Common\Collection\ArrayCollection
implements
Countable
-
OpenCloud\Common\Collection\ResourceIterator
implements
Iterator
-
OpenCloud\Common\Collection\PaginatedIterator
implements
Iterator
Direct known subclasses
OpenCloud\CloudMonitoring\Collection\MonitoringIterator,
OpenCloud\DNS\Collection\DnsIterator,
OpenCloud\LoadBalancer\Collection\LoadBalancerIterator,
OpenCloud\Queues\Collection\MessageIterator
Package: OpenCloud\Common\Collection
Since: 1.8.0
Located at OpenCloud/Common/Collection/PaginatedIterator.php
Methods summary
public static
static
|
|
public
|
|
public
mixed
|
|
public
integer|mixed
|
|
public
|
|
public
|
#
updateMarkerToCurrent( )
Update the current marker based on the current element. The marker will be based on a particular property of this current element, so you must retrieve it first. |
public
|
|
public
boolean
|
|
public
|
|
public
|
#
appendNewCollection( )
Retrieve a new page of elements from the API (based on a new request), parse its response, and append them to the collection. |
public
boolean
|
#
extractNextLink( $body )
Based on the response body, extract the explicitly set "link" value if provided. |
public
Guzzle\Http\Url|string
|
|
public
array
|
#
parseResponseBody( $body )
Based on the response from the API, parse it for the data we need (i.e. an meaningful array of elements). |
public
|
Methods inherited from OpenCloud\Common\Collection\ResourceIterator
constructResource(),
currentElement(),
getElement(),
getOption(),
getOptions(),
search(),
setOption(),
setOptions(),
setResourceParent(),
sort()
Methods inherited from OpenCloud\Common\Collection\ArrayCollection
__construct(),
append(),
count(),
setElements(),
valueExists()
Methods inherited from OpenCloud\Common\ArrayAccess
offsetExists(),
offsetGet(),
offsetSet(),
offsetUnset()
Magic methods summary
Constants summary
string |
MARKER
|
#
'marker'
|
string |
LIMIT
|
#
'limit'
|