Properties

$calledNext

$calledNext : 

Type

$resources

$resources : array

Type

array — Currently loaded resources

$retrievedCount

$retrievedCount : integer

Type

integer — Total number of resources that have been retrieved

$iteratedCount

$iteratedCount : integer

Type

integer — Total number of resources that have been iterated

$nextToken

$nextToken : string

Type

string — NextToken/Marker for a subsequent request

$pageSize

$pageSize : integer

Type

integer — Maximum number of resources to fetch per request

$limit

$limit : integer

Type

integer — Maximum number of resources to retrieve in total

$requestCount

$requestCount : integer

Type

integer — Number of requests sent

$data

$data : array

Type

array — Initial data passed to the constructor

$invalid

$invalid : boolean

Type

boolean — Whether or not the current value is known to be invalid

Methods

getAllEvents()

getAllEvents() : array

Get a list of all of the events emitted from the class

Returns

array

__construct()

__construct(\Guzzle\Service\Command\CommandInterface  $command, array  $data = array()) 

Parameters

\Guzzle\Service\Command\CommandInterface $command

Initial command used for iteration

array $data

Associative array of additional parameters. You may specify any number of custom options for an iterator. Among these options, you may also specify the following values:

  • limit: Attempt to limit the maximum number of resources to this amount
  • page_size: Attempt to retrieve this number of resources per request

toArray()

toArray() : array

Get all of the resources as an array (Warning: this could issue a large number of requests)

Returns

array

setLimit()

setLimit(integer  $limit) : \Guzzle\Service\Resource\ResourceIteratorInterface

Attempt to limit the total number of resources returned by the iterator.

You may still receive more items than you specify. Set to 0 to specify no limit.

Parameters

integer $limit

Limit amount

Returns

\Guzzle\Service\Resource\ResourceIteratorInterface

setPageSize()

setPageSize(integer  $pageSize) : \Guzzle\Service\Resource\ResourceIteratorInterface

Attempt to limit the total number of resources retrieved per request by the iterator.

The iterator may return more than you specify in the page size argument depending on the service and underlying command implementation. Set to 0 to specify no page size limitation.

Parameters

integer $pageSize

Limit amount

Returns

\Guzzle\Service\Resource\ResourceIteratorInterface

get()

get(string  $key) : mixed|null

Get an option from the iterator

Parameters

string $key

Key of the option to retrieve

Returns

mixed|null —

Returns NULL if not set or the value if set

set()

set(string  $key, mixed  $value) : \Guzzle\Service\Resource\ResourceIterator

Set an option on the iterator

Parameters

string $key

Key of the option to set

mixed $value

Value to set for the option

Returns

\Guzzle\Service\Resource\ResourceIterator

current()

current() 

key()

key() 

count()

count() 

getRequestCount()

getRequestCount() : integer

Get the total number of requests sent

Returns

integer

rewind()

rewind() 

Rewind the Iterator to the first element and send the original command

valid()

valid() 

next()

next() 

getNextToken()

getNextToken() : string

Retrieve the NextToken that can be used in other iterators.

Returns

string —

Returns a NextToken

dispatch()

dispatch(string  $eventName, array  $context = array()) : \Guzzle\Common\Event

Helper to dispatch Guzzle events and set the event name on the event

Parameters

string $eventName

Name of the event to dispatch

array $context

Context of the event

Returns

\Guzzle\Common\Event

Returns the created event object

getResources()

getResources() 

getIteratedCount()

getIteratedCount() 

calculatePageSize()

calculatePageSize() : integer

Returns the value that should be specified for the page size for a request that will maintain any hard limits, but still honor the specified pageSize if the number of items retrieved + pageSize < hard limit

Returns

integer —

Returns the page size of the next request.

resetState()

resetState() 

Reset the internal state of the iterator without triggering a rewind()

sendRequest()

sendRequest() : array

Send a request to retrieve the next page of results. Hook for subclasses to implement.

Returns

array —

Returns the newly loaded resources