|
21 | 21 | * |
22 | 22 | * @author Tobias Nyholm <[email protected]> |
23 | 23 | */ |
24 | | -class DoctrineTaggingCachePool implements CacheItemPoolInterface |
| 24 | +class FixedTaggingCachePool implements CacheItemPoolInterface |
25 | 25 | { |
26 | 26 | /** |
27 | 27 | * @type CacheItemPoolInterface|TaggablePoolInterface |
28 | 28 | */ |
29 | 29 | private $cache; |
30 | 30 |
|
| 31 | + /** |
| 32 | + * @type array |
| 33 | + */ |
| 34 | + private $tags; |
| 35 | + |
31 | 36 | /** |
32 | 37 | * @param TaggablePoolInterface $cache |
| 38 | + * @param array $tags |
33 | 39 | */ |
34 | | - public function __construct(TaggablePoolInterface $cache) |
| 40 | + public function __construct(TaggablePoolInterface $cache, array $tags) |
35 | 41 | { |
36 | 42 | $this->cache = $cache; |
| 43 | + $this->tags = $tags; |
37 | 44 | } |
38 | 45 |
|
39 | 46 | /** |
40 | | - * @{@inheritdoc} |
| 47 | + * {@inheritdoc} |
41 | 48 | */ |
42 | 49 | public function getItem($key) |
43 | 50 | { |
44 | | - return $this->cache->getItem($key, ['doctrine']); |
| 51 | + return $this->cache->getItem($key, $this->tags); |
45 | 52 | } |
46 | 53 |
|
47 | 54 | /** |
48 | | - * @{@inheritdoc} |
| 55 | + * {@inheritdoc} |
49 | 56 | */ |
50 | 57 | public function getItems(array $keys = []) |
51 | 58 | { |
52 | | - return $this->cache->getItems($keys, ['doctrine']); |
| 59 | + return $this->cache->getItems($keys, $this->tags); |
53 | 60 | } |
54 | 61 |
|
55 | 62 | /** |
56 | | - * @{@inheritdoc} |
| 63 | + * {@inheritdoc} |
57 | 64 | */ |
58 | 65 | public function hasItem($key) |
59 | 66 | { |
60 | | - return $this->cache->hasItem($key, ['doctrine']); |
| 67 | + return $this->cache->hasItem($key, $this->tags); |
61 | 68 | } |
62 | 69 |
|
63 | 70 | /** |
64 | | - * @{@inheritdoc} |
| 71 | + * {@inheritdoc} |
65 | 72 | */ |
66 | 73 | public function clear() |
67 | 74 | { |
68 | | - return $this->cache->clear(['doctrine']); |
| 75 | + return $this->cache->clear($this->tags); |
69 | 76 | } |
70 | 77 |
|
71 | 78 | /** |
72 | | - * @{@inheritdoc} |
| 79 | + * {@inheritdoc} |
73 | 80 | */ |
74 | 81 | public function deleteItem($key) |
75 | 82 | { |
76 | | - return $this->cache->deleteItem($key, ['doctrine']); |
| 83 | + return $this->cache->deleteItem($key, $this->tags); |
77 | 84 | } |
78 | 85 |
|
79 | 86 | /** |
80 | | - * @{@inheritdoc} |
| 87 | + * {@inheritdoc} |
81 | 88 | */ |
82 | 89 | public function deleteItems(array $keys) |
83 | 90 | { |
84 | | - return $this->cache->deleteItems($keys, ['doctrine']); |
| 91 | + return $this->cache->deleteItems($keys, $this->tags); |
85 | 92 | } |
86 | 93 |
|
87 | 94 | /** |
88 | | - * @{@inheritdoc} |
| 95 | + * {@inheritdoc} |
89 | 96 | */ |
90 | 97 | public function save(CacheItemInterface $item) |
91 | 98 | { |
92 | 99 | return $this->cache->save($item); |
93 | 100 | } |
94 | 101 |
|
95 | 102 | /** |
96 | | - * @{@inheritdoc} |
| 103 | + * {@inheritdoc} |
97 | 104 | */ |
98 | 105 | public function saveDeferred(CacheItemInterface $item) |
99 | 106 | { |
100 | 107 | return $this->cache->saveDeferred($item); |
101 | 108 | } |
102 | 109 |
|
103 | 110 | /** |
104 | | - * @{@inheritdoc} |
| 111 | + * {@inheritdoc} |
105 | 112 | */ |
106 | 113 | public function commit() |
107 | 114 | { |
|
0 commit comments