1 | <?php |
||
15 | class CacheManager implements CacheManagerInterface |
||
16 | { |
||
17 | /** @var CacheItemPoolInterface[] */ |
||
18 | private $adapters = []; |
||
19 | |||
20 | /** @var string */ |
||
21 | private $defaultAdapter = null; |
||
22 | |||
23 | 11 | public function __construct(array $adapters = [], $defaultAdapterName = null) |
|
33 | |||
34 | /** |
||
35 | * @param string $name |
||
36 | * @param CacheItemPoolInterface $adapter |
||
37 | * @param bool $default Should this adapter be marked as default? |
||
38 | * |
||
39 | * @throws CacheException |
||
40 | */ |
||
41 | 11 | public function addAdapter($name, CacheItemPoolInterface $adapter, $default = false) |
|
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | 6 | public function getAdapter($name) |
|
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | 8 | public function hasAdapter($name) |
|
77 | |||
78 | /** |
||
79 | * {@inheritdoc} |
||
80 | */ |
||
81 | 2 | public function hasAdapterInstance(CacheItemPoolInterface $adapter) |
|
85 | |||
86 | /** |
||
87 | * @param string $name |
||
88 | */ |
||
89 | 1 | public function removeAdapter($name) |
|
95 | |||
96 | /** |
||
97 | * @param string $name |
||
98 | * @throws CacheException |
||
99 | */ |
||
100 | 5 | public function setDefaultAdapterName($name) |
|
108 | |||
109 | /** |
||
110 | * {@inheritdoc} |
||
111 | */ |
||
112 | 4 | public function getDefaultAdapter() |
|
120 | } |
||
121 |