MapResourceIteratorFactory
extends AbstractResourceIteratorFactory
in package
Resource iterator factory used when explicitly mapping strings to iterator classes
Table of Contents
Properties
- $map : array<string|int, mixed>
Methods
- __construct() : mixed
- build() : ResourceIteratorInterface
- Create a resource iterator
- canBuild() : bool
- Check if the factory can create an iterator
- getClassName() : string
- Get the name of the class to instantiate for the command
Properties
$map
protected
array<string|int, mixed>
$map
Associative array mapping iterator names to class names
Methods
__construct()
public
__construct(array<string|int, mixed> $map) : mixed
Parameters
- $map : array<string|int, mixed>
-
Associative array mapping iterator names to class names
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
boolgetClassName()
Get the name of the class to instantiate for the command
public
getClassName(CommandInterface $command) : string
Parameters
- $command : CommandInterface
-
Command that is associated with the iterator