ListObjectVersionsIterator
extends AwsResourceIterator
in package
Iterator for an S3 ListObjectVersions command
This iterator includes the following additional options:
- return_prefixes: Set to true to receive both prefixes and versions in results
Table of Contents
Properties
- $command : CommandInterface
- $data : array<string|int, mixed>
- $eventDispatcher : EventDispatcherInterface
- $invalid : bool
- $iteratedCount : int
- $lastResult : Model
- $limit : int
- $nextToken : string
- $originalCommand : CommandInterface
- $pageSize : int
- $requestCount : int
- $resources : array<string|int, mixed>
- $retrievedCount : int
Methods
- __construct() : mixed
- addSubscriber() : self
- Add an event subscriber to the dispatcher
- count() : mixed
- current() : mixed
- dispatch() : Event
- Helper to dispatch Guzzle events and set the event name on the event
- get() : mixed|null
- Get an option from the iterator
- getAllEvents() : array<string|int, mixed>
- Get a list of all of the events emitted from the class
- getEventDispatcher() : EventDispatcherInterface
- Get the EventDispatcher of the request
- getLastResult() : Model|null
- Provides access to the most recent result obtained by the iterator. This makes it easier to extract any additional information from the result which you do not have access to from the values emitted by the iterator
- getNextToken() : string
- Retrieve the NextToken that can be used in other iterators.
- getRequestCount() : int
- Get the total number of requests sent
- key() : mixed
- next() : mixed
- rewind() : mixed
- Rewind the Iterator to the first element and send the original command
- set() : ResourceIterator
- Set an option on the iterator
- setEventDispatcher() : self
- Set the EventDispatcher of the request
- setLimit() : ResourceIteratorInterface
- Attempt to limit the total number of resources returned by the iterator.
- setPageSize() : ResourceIteratorInterface
- Attempt to limit the total number of resources retrieved per request by the iterator.
- toArray() : array<string|int, mixed>
- Get all of the resources as an array (Warning: this could issue a large number of requests)
- valid() : mixed
- applyNextToken() : mixed
- calculatePageSize() : int
- 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
- determineNextToken() : mixed
- getValueFromResult() : mixed|null
- Extracts the value from the result using Collection::getPath. Also adds some additional logic for keys that need to access n-1 indexes (e.g., ImportExport, Kinesis). The n-1 logic only works for the known cases. We will switch to a jmespath implementation in the future to cover all cases
- handleResults() : mixed
- prepareRequest() : mixed
- resetState() : mixed
- Reset the internal state of the iterator without triggering a rewind()
- sendRequest() : array<string|int, mixed>
- {@inheritdoc} This AWS specific version of the resource iterator provides a default implementation of the typical AWS iterator process. It relies on configuration and extension to implement the operation-specific logic of handling results and nextTokens. This method will loop until resources are acquired or there are no more iterations available.
Properties
$command
protected
CommandInterface
$command
Command used to send requests
$data
protected
array<string|int, mixed>
$data
= array()
Initial data passed to the constructor
$eventDispatcher
protected
EventDispatcherInterface
$eventDispatcher
$invalid
protected
bool
$invalid
Whether or not the current value is known to be invalid
$iteratedCount
protected
int
$iteratedCount
= 0
Total number of resources that have been iterated
$lastResult
protected
Model
$lastResult
= null
Result of a command
$limit
protected
int
$limit
Maximum number of resources to retrieve in total
$nextToken
protected
string
$nextToken
= false
NextToken/Marker for a subsequent request
$originalCommand
protected
CommandInterface
$originalCommand
First sent command
$pageSize
protected
int
$pageSize
Maximum number of resources to fetch per request
$requestCount
protected
int
$requestCount
= 0
Number of requests sent
$resources
protected
array<string|int, mixed>
$resources
Currently loaded resources
$retrievedCount
protected
int
$retrievedCount
= 0
Total number of resources that have been retrieved
Methods
__construct()
public
__construct(CommandInterface $command[, array<string|int, mixed> $data = array() ]) : mixed
Parameters
- $command : CommandInterface
-
Initial command used for iteration
- $data : array<string|int, mixed> = array()
-
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
addSubscriber()
Add an event subscriber to the dispatcher
public
addSubscriber(EventSubscriberInterface $subscriber) : self
Parameters
- $subscriber : EventSubscriberInterface
-
Event subscriber
Return values
selfcount()
public
count() : mixed
current()
public
current() : mixed
dispatch()
Helper to dispatch Guzzle events and set the event name on the event
public
dispatch(mixed $eventName[, array<string|int, mixed> $context = array() ]) : Event
Parameters
- $eventName : mixed
-
Name of the event to dispatch
- $context : array<string|int, mixed> = array()
-
Context of the event
Return values
Event —Returns the created event object
get()
Get an option from the iterator
public
get(string $key) : mixed|null
Parameters
- $key : string
-
Key of the option to retrieve
Return values
mixed|null —Returns NULL if not set or the value if set
getAllEvents()
Get a list of all of the events emitted from the class
public
static getAllEvents() : array<string|int, mixed>
Return values
array<string|int, mixed>getEventDispatcher()
Get the EventDispatcher of the request
public
getEventDispatcher() : EventDispatcherInterface
Return values
EventDispatcherInterfacegetLastResult()
Provides access to the most recent result obtained by the iterator. This makes it easier to extract any additional information from the result which you do not have access to from the values emitted by the iterator
public
getLastResult() : Model|null
Return values
Model|nullgetNextToken()
Retrieve the NextToken that can be used in other iterators.
public
getNextToken() : string
Return values
string —Returns a NextToken
getRequestCount()
Get the total number of requests sent
public
getRequestCount() : int
Return values
intkey()
public
key() : mixed
next()
public
next() : mixed
rewind()
Rewind the Iterator to the first element and send the original command
public
rewind() : mixed
set()
Set an option on the iterator
public
set(string $key, mixed $value) : ResourceIterator
Parameters
- $key : string
-
Key of the option to set
- $value : mixed
-
Value to set for the option
Return values
ResourceIteratorsetEventDispatcher()
Set the EventDispatcher of the request
public
setEventDispatcher(EventDispatcherInterface $eventDispatcher) : self
Parameters
- $eventDispatcher : EventDispatcherInterface
Return values
selfsetLimit()
Attempt to limit the total number of resources returned by the iterator.
public
setLimit(mixed $limit) : ResourceIteratorInterface
You may still receive more items than you specify. Set to 0 to specify no limit.
Parameters
- $limit : mixed
-
Limit amount
Return values
ResourceIteratorInterfacesetPageSize()
Attempt to limit the total number of resources retrieved per request by the iterator.
public
setPageSize(mixed $pageSize) : ResourceIteratorInterface
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
- $pageSize : mixed
-
Limit amount
Return values
ResourceIteratorInterfacetoArray()
Get all of the resources as an array (Warning: this could issue a large number of requests)
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>valid()
public
valid() : mixed
applyNextToken()
protected
applyNextToken() : mixed
calculatePageSize()
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
protected
calculatePageSize() : int
Return values
int —Returns the page size of the next request.
determineNextToken()
protected
determineNextToken(Model $result) : mixed
Parameters
- $result : Model
getValueFromResult()
Extracts the value from the result using Collection::getPath. Also adds some additional logic for keys that need to access n-1 indexes (e.g., ImportExport, Kinesis). The n-1 logic only works for the known cases. We will switch to a jmespath implementation in the future to cover all cases
protected
getValueFromResult(Model $result, string $key) : mixed|null
Parameters
- $result : Model
- $key : string
Return values
mixed|nullhandleResults()
protected
handleResults(Model $result) : mixed
Parameters
- $result : Model
prepareRequest()
protected
prepareRequest() : mixed
resetState()
Reset the internal state of the iterator without triggering a rewind()
protected
resetState() : mixed
sendRequest()
{@inheritdoc} This AWS specific version of the resource iterator provides a default implementation of the typical AWS iterator process. It relies on configuration and extension to implement the operation-specific logic of handling results and nextTokens. This method will loop until resources are acquired or there are no more iterations available.
protected
sendRequest() : array<string|int, mixed>
Return values
array<string|int, mixed> —Returns the newly loaded resources