ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ArrayAdapter.php
Go to the documentation of this file.
1 <?php
2 
4 
8 class ArrayAdapter implements Queryable
9 {
13  private $configuration;
14 
18  public function __construct(array $configuration)
19  {
20  $this->configuration = $configuration;
21  }
22 
23  public function get($key, $defaultValue = null)
24  {
25  if (!$this->has($key)) {
26  return $defaultValue;
27  }
28 
29  return $this->configuration[$key];
30  }
31 
32  public function has($key)
33  {
34  return array_key_exists($key, $this->configuration);
35  }
36 }
Default implementation for configuration.
Definition: ArrayAdapter.php:8
has($key)
Query for whether or not the configuration has a value for the key.
$key
Definition: croninfo.php:18
__construct(array $configuration)