1 | <?php |
||
22 | class LazyRegistry implements LazyRegistryInterface |
||
23 | { |
||
24 | /** |
||
25 | * @var ContainerInterface |
||
26 | */ |
||
27 | private $container; |
||
28 | |||
29 | /** |
||
30 | * @var RegistryInterface |
||
31 | */ |
||
32 | private $registry; |
||
33 | |||
34 | /** |
||
35 | * @var string[] |
||
36 | */ |
||
37 | private $services = []; |
||
38 | |||
39 | /** |
||
40 | * @param ContainerInterface $container |
||
41 | * @param RegistryInterface $registry |
||
42 | * @param string[] $services |
||
43 | */ |
||
44 | public function __construct(ContainerInterface $container, RegistryInterface $registry, array $services = []) |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | public function hasLazy($type) |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | public function getLazy($type) |
||
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | public function setLazy($type, $service) |
||
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | public function removeLazy($type) |
||
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | public function offsetExists($offset) |
||
109 | |||
110 | /** |
||
111 | * {@inheritdoc} |
||
112 | */ |
||
113 | public function offsetGet($offset) |
||
119 | |||
120 | /** |
||
121 | * {@inheritdoc} |
||
122 | */ |
||
123 | public function offsetSet($offset, $value) |
||
131 | |||
132 | /** |
||
133 | * {@inheritdoc} |
||
134 | */ |
||
135 | public function offsetUnset($offset) |
||
147 | |||
148 | /** |
||
149 | * {@inheritdoc} |
||
150 | */ |
||
151 | public function count() |
||
157 | |||
158 | /** |
||
159 | * {@inheritdoc} |
||
160 | */ |
||
161 | public function getIterator() |
||
167 | |||
168 | private function load() |
||
174 | |||
175 | /** |
||
176 | * @param string $type |
||
177 | */ |
||
178 | private function lazyLoad($type) |
||
184 | } |
||
185 |