AwsResourceIteratorFactory
in package
implements
ResourceIteratorFactoryInterface
Resource iterator factory used to instantiate the default AWS resource iterator with the correct configuration or use a concrete iterator class if one exists
Table of Contents
Interfaces
- ResourceIteratorFactoryInterface
- Factory for creating {@see ResourceIteratorInterface} objects
Properties
- $config : array<string|int, mixed>
- $defaultIteratorConfig : array<string|int, mixed>
- $primaryIteratorFactory : ResourceIteratorFactoryInterface
- $legacyConfigOptions : array<string|int, mixed>
Methods
- __construct() : mixed
- build() : ResourceIteratorInterface
- Create a resource iterator
- canBuild() : bool
- Check if the factory can create an iterator
- translateLegacyConfigOptions() : array<string|int, mixed>
Properties
$config
protected
array<string|int, mixed>
$config
Iterator configuration for each iterable operation
$defaultIteratorConfig
protected
static array<string|int, mixed>
$defaultIteratorConfig
= array('input_token' => null, 'output_token' => null, 'limit_key' => null, 'result_key' => null, 'more_results' => null)
Default configuration values for iterators
$primaryIteratorFactory
protected
ResourceIteratorFactoryInterface
$primaryIteratorFactory
Another factory that will be used first to instantiate the iterator
$legacyConfigOptions
private
static array<string|int, mixed>
$legacyConfigOptions
= array('token_param' => 'input_token', 'token_key' => 'output_token', 'limit_param' => 'limit_key', 'more_key' => 'more_results')
Legacy configuration options mapped to their new names
Methods
__construct()
public
__construct(array<string|int, mixed> $config[, ResourceIteratorFactoryInterface $primaryIteratorFactory = null ]) : mixed
Parameters
- $config : array<string|int, mixed>
-
An array of configuration values for the factory
- $primaryIteratorFactory : ResourceIteratorFactoryInterface = null
-
Another factory to use for chain of command
build()
Create a resource iterator
public
build(CommandInterface $command[, array<string|int, mixed> $options = array() ]) : ResourceIteratorInterface
Parameters
- $command : CommandInterface
-
Command to create an iterator for
- $options : array<string|int, mixed> = array()
-
Iterator options that are exposed as data.
Return values
ResourceIteratorInterfacecanBuild()
Check if the factory can create an iterator
public
canBuild(CommandInterface $command) : bool
Parameters
- $command : CommandInterface
-
Command to create an iterator for
Return values
booltranslateLegacyConfigOptions()
private
translateLegacyConfigOptions(array<string|int, mixed> $config) : array<string|int, mixed>
Parameters
- $config : array<string|int, mixed>
-
The config for a single operation
Return values
array<string|int, mixed> —The modified config with legacy options translated