1 | <?php |
||
21 | class CachingLoader extends CachingLoaderDecorator |
||
22 | { |
||
23 | |||
24 | /** |
||
25 | * @var string $identifier |
||
26 | */ |
||
27 | protected $identifier; |
||
28 | |||
29 | /** |
||
30 | * @var CollectionInterface $cache |
||
31 | */ |
||
32 | protected $cache; |
||
33 | |||
34 | /** |
||
35 | * @var ObjectIdentifier |
||
36 | */ |
||
37 | private $object_identifier; |
||
38 | |||
39 | |||
40 | /** |
||
41 | * CachingLoader constructor. |
||
42 | * |
||
43 | * @param LoaderDecoratorInterface $loader |
||
44 | * @param CollectionInterface $cache |
||
45 | * @param ObjectIdentifier $object_identifier |
||
46 | * @param string $identifier |
||
47 | * @throws InvalidDataTypeException |
||
48 | */ |
||
49 | public function __construct( |
||
75 | |||
76 | |||
77 | /** |
||
78 | * @return string |
||
79 | */ |
||
80 | public function identifier() |
||
84 | |||
85 | |||
86 | /** |
||
87 | * @param string $identifier |
||
88 | * @throws InvalidDataTypeException |
||
89 | */ |
||
90 | private function setIdentifier($identifier) |
||
97 | |||
98 | |||
99 | /** |
||
100 | * @param FullyQualifiedName|string $fqcn |
||
101 | * @param mixed $object |
||
102 | * @return bool |
||
103 | * @throws InvalidArgumentException |
||
104 | */ |
||
105 | public function share($fqcn, $object) |
||
120 | |||
121 | |||
122 | /** |
||
123 | * @param FullyQualifiedName|string $fqcn |
||
124 | * @param array $arguments |
||
125 | * @param bool $shared |
||
126 | * @param array $interfaces |
||
127 | * @return mixed |
||
128 | */ |
||
129 | public function load($fqcn, $arguments = array(), $shared = true, array $interfaces = array()) |
||
155 | |||
156 | |||
157 | /** |
||
158 | * empties cache and calls reset() on loader if method exists |
||
159 | */ |
||
160 | public function reset() |
||
165 | |||
166 | |||
167 | /** |
||
168 | * unsets and detaches ALL objects from the cache |
||
169 | * |
||
170 | * @since $VID:$ |
||
171 | */ |
||
172 | public function clearCache() |
||
176 | } |
||
177 | // End of file CachingLoader.php |
||
179 |