Open Journal Systems  3.3.0
AbstractResourceIteratorFactory.php
1 <?php
2 
4 
7 
12 {
13  public function build(CommandInterface $command, array $options = array())
14  {
15  if (!$this->canBuild($command)) {
16  throw new InvalidArgumentException('Iterator was not found for ' . $command->getName());
17  }
18 
19  $className = $this->getClassName($command);
20 
21  return new $className($command, $options);
22  }
23 
24  public function canBuild(CommandInterface $command)
25  {
26  return (bool) $this->getClassName($command);
27  }
28 
36  abstract protected function getClassName(CommandInterface $command);
37 }
Guzzle\Service\Resource\AbstractResourceIteratorFactory\build
build(CommandInterface $command, array $options=array())
Definition: AbstractResourceIteratorFactory.php:13
Guzzle\Service\Resource\AbstractResourceIteratorFactory\canBuild
canBuild(CommandInterface $command)
Definition: AbstractResourceIteratorFactory.php:24
Guzzle\Service\Command\CommandInterface
Definition: CommandInterface.php:17
Guzzle\Common\Exception\InvalidArgumentException
Definition: lib/vendor/guzzle/guzzle/src/Guzzle/Common/Exception/InvalidArgumentException.php:5
Guzzle\Service\Command\CommandInterface\getName
getName()
Guzzle\Service\Resource\AbstractResourceIteratorFactory\getClassName
getClassName(CommandInterface $command)
Guzzle\Service\Resource
Definition: AbstractResourceIteratorFactory.php:3
Guzzle\Service\Resource\AbstractResourceIteratorFactory
Definition: AbstractResourceIteratorFactory.php:11
Guzzle\Service\Resource\ResourceIteratorFactoryInterface
Definition: ResourceIteratorFactoryInterface.php:10