Open Journal Systems  3.3.0
MapResourceIteratorFactory.php
1 <?php
2 
4 
6 
11 {
13  protected $map;
14 
16  public function __construct(array $map)
17  {
18  $this->map = $map;
19  }
20 
21  public function getClassName(CommandInterface $command)
22  {
23  $className = $command->getName();
24 
25  if (isset($this->map[$className])) {
26  return $this->map[$className];
27  } elseif (isset($this->map['*'])) {
28  // If a wildcard was added, then always use that
29  return $this->map['*'];
30  }
31 
32  return null;
33  }
34 }
Guzzle\Service\Resource\MapResourceIteratorFactory\$map
$map
Definition: MapResourceIteratorFactory.php:16
Guzzle\Service\Resource\MapResourceIteratorFactory\__construct
__construct(array $map)
Definition: MapResourceIteratorFactory.php:19
Guzzle\Service\Command\CommandInterface
Definition: CommandInterface.php:17
Guzzle\Service\Resource\MapResourceIteratorFactory
Definition: MapResourceIteratorFactory.php:10
Guzzle\Service\Command\CommandInterface\getName
getName()
Guzzle\Service\Resource
Definition: AbstractResourceIteratorFactory.php:3
Guzzle\Service\Resource\AbstractResourceIteratorFactory
Definition: AbstractResourceIteratorFactory.php:11
Guzzle\Service\Resource\MapResourceIteratorFactory\getClassName
getClassName(CommandInterface $command)
Definition: MapResourceIteratorFactory.php:24