1 | <?php |
||
33 | trait DelegateContainerTrait |
||
34 | { |
||
35 | /** |
||
36 | * @var ContainerInterface[] |
||
37 | */ |
||
38 | protected $delegateContainers = []; |
||
39 | |||
40 | /** |
||
41 | * @param ContainerInterface $container |
||
42 | */ |
||
43 | 3 | public function addDelegateContainer(ContainerInterface $container) |
|
47 | |||
48 | /** |
||
49 | * @return ContainerInterface[] |
||
50 | */ |
||
51 | 3 | public function getDelegateContainers() |
|
55 | |||
56 | /** |
||
57 | * Check if any delegated containers has a entry. |
||
58 | * |
||
59 | * @param string $id Identifier of the entry to look for. |
||
60 | * |
||
61 | * @return bool TRUE if any delegated container has the key, FALSE otherwise. |
||
62 | */ |
||
63 | 3 | protected function delegateHas($id) |
|
73 | |||
74 | /** |
||
75 | * Finds an entry in the delegated container by its identifier and returns it. |
||
76 | * |
||
77 | * @param string $id Identifier of the entry to look for. |
||
78 | * |
||
79 | * @throws NotFoundException No entry was found for this identifier. |
||
80 | * @throws ContainerException Error while retrieving the entry. |
||
81 | * |
||
82 | * @return mixed Entry. |
||
83 | */ |
||
84 | 6 | protected function delegateGet($id) |
|
94 | } |
||
95 |