1 | <?php |
||
11 | class CompositeContainer implements ContainerInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var array Containers that are contained within this composite container |
||
15 | */ |
||
16 | protected $containers = array(); |
||
17 | |||
18 | /** |
||
19 | * @param array $containers Containers to add to this composite container |
||
20 | */ |
||
21 | 3 | public function __construct(array $containers = array()) |
|
27 | |||
28 | /** |
||
29 | * Adds a container to an internal queue of containers |
||
30 | * |
||
31 | * @param ContainerInterface $container The container to add |
||
32 | * |
||
33 | * @return $this |
||
34 | */ |
||
35 | 2 | public function addContainer(ContainerInterface $container) |
|
41 | |||
42 | /** |
||
43 | * Finds an entry of the container by delegating the get call to a FIFO queue of internal containers |
||
44 | * |
||
45 | * {@inheritDoc} |
||
46 | */ |
||
47 | 3 | public function get($id) |
|
58 | |||
59 | /** |
||
60 | * Returns true if the at least one of the internal containers can return an entry for the given identifier |
||
61 | * Returns false otherwise. |
||
62 | * |
||
63 | * {@inheritDoc} |
||
64 | */ |
||
65 | 3 | public function has($id) |
|
76 | } |
||
77 |