CompositeResourceIteratorFactory
in package
implements
ResourceIteratorFactoryInterface
Factory that utilizes multiple factories for creating iterators
Table of Contents
Interfaces
- ResourceIteratorFactoryInterface
- Factory for creating {@see ResourceIteratorInterface} objects
Properties
- $factories : array<string|int, mixed>
Methods
- __construct() : mixed
- addFactory() : self
- Add a factory to the composite factory
- build() : ResourceIteratorInterface
- Create a resource iterator
- canBuild() : bool
- Check if the factory can create an iterator
- getFactory() : ResourceIteratorFactoryInterface|bool
- Get the factory that matches the command object
Properties
$factories
protected
array<string|int, mixed>
$factories
Array of factories
Methods
__construct()
public
__construct(array<string|int, mixed> $factories) : mixed
Parameters
- $factories : array<string|int, mixed>
-
Array of factories used to instantiate iterators
addFactory()
Add a factory to the composite factory
public
addFactory(ResourceIteratorFactoryInterface $factory) : self
Parameters
- $factory : ResourceIteratorFactoryInterface
-
Factory to add
Return values
selfbuild()
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
boolgetFactory()
Get the factory that matches the command object
protected
getFactory(CommandInterface $command) : ResourceIteratorFactoryInterface|bool
Parameters
- $command : CommandInterface
-
Command retrieving the iterator for