SDK for PHP 3.x

ResultPaginator
in package
implements Iterator

Iterator that yields each page of results of a pageable operation.

Table of Contents

Interfaces

Iterator

Methods

__construct()  : mixed
current()  : Result
each()  : Promise
Runs a paginator asynchronously and uses a callback to handle results.
key()  : mixed
next()  : mixed
rewind()  : mixed
search()  : Iterator
Returns an iterator that iterates over the values of applying a JMESPath search to each result yielded by the iterator as a flat sequence.
valid()  : mixed

Methods

__construct()

public __construct(AwsClientInterface $client, string $operation, array<string|int, mixed> $args, array<string|int, mixed> $config) : mixed
Parameters
$client : AwsClientInterface
$operation : string
$args : array<string|int, mixed>
$config : array<string|int, mixed>

each()

Runs a paginator asynchronously and uses a callback to handle results.

public each(callable $handleResult) : Promise

The callback should have the signature: function (Aws\Result $result). A non-null return value from the callback will be yielded by the promise. This means that you can return promises from the callback that will need to be resolved before continuing iteration over the remaining items, essentially merging in other promises to the iteration. The last non-null value returned by the callback will be the result that fulfills the promise to any downstream promises.

Parameters
$handleResult : callable

Callback for handling each page of results. The callback accepts the result that was yielded as a single argument. If the callback returns a promise, the promise will be merged into the coroutine.

Return values
Promise

key()

public key() : mixed

next()

public next() : mixed

rewind()

public rewind() : mixed

Returns an iterator that iterates over the values of applying a JMESPath search to each result yielded by the iterator as a flat sequence.

public search(string $expression) : Iterator
Parameters
$expression : string

JMESPath expression to apply to each result.

Return values
Iterator

valid()

public valid() : mixed
On this page