Skip to content

Commit 47f89ce

Browse files
committed
Pass keys that is not a hierarchy key
1 parent a63c33c commit 47f89ce

File tree

1 file changed

+46
-4
lines changed

1 file changed

+46
-4
lines changed

src/HierarchicalCachePool.php

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,49 +37,91 @@ public function __construct(CacheItemPoolInterface $cache)
3737
$this->cache = $cache;
3838
}
3939

40+
/**
41+
* {@inheritdoc}
42+
*/
4043
public function getItem($key, array $tags = [])
4144
{
45+
if (!$this->isHierarchyKey($key)) {
46+
return $this->cache->getItem($key, $tags);
47+
}
4248
// TODO: Implement getItem() method.
4349
}
4450

51+
/**
52+
* {@inheritdoc}
53+
*/
4554
public function getItems(array $keys = [], array $tags = [])
4655
{
56+
if (!$this->isHierarchyKey($keys)) {
57+
return $this->cache->getItems($keys, $tags);
58+
}
4759
// TODO: Implement getItems() method.
4860
}
4961

62+
/**
63+
* {@inheritdoc}
64+
*/
5065
public function hasItem($key, array $tags = [])
5166
{
67+
if (!$this->isHierarchyKey($key)) {
68+
return $this->cache->hasItem($key, $tags);
69+
}
5270
// TODO: Implement hasItem() method.
5371
}
5472

73+
/**
74+
* {@inheritdoc}
75+
*/
5576
public function clear(array $tags = [])
5677
{
57-
// TODO: Implement clear() method.
78+
return $this->cache->clear($tags);
5879
}
5980

81+
/**
82+
* {@inheritdoc}
83+
*/
6084
public function deleteItem($key, array $tags = [])
6185
{
86+
if (!$this->isHierarchyKey($key)) {
87+
return $this->cache->deleteItem($key, $tags);
88+
}
6289
// TODO: Implement deleteItem() method.
6390
}
6491

92+
/**
93+
* {@inheritdoc}
94+
*/
6595
public function deleteItems(array $keys, array $tags = [])
6696
{
97+
if (!$this->isHierarchyKey($keys)) {
98+
return $this->cache->deleteItems($keys, $tags);
99+
}
67100
// TODO: Implement deleteItems() method.
68101
}
69102

103+
/**
104+
* {@inheritdoc}
105+
*/
70106
public function save(CacheItemInterface $item)
71107
{
72-
// TODO: Implement save() method.
108+
$this->cache->save($item);
73109
}
74110

111+
/**
112+
* {@inheritdoc}
113+
*/
75114
public function saveDeferred(CacheItemInterface $item)
76115
{
77-
// TODO: Implement saveDeferred() method.
116+
$this->cache->saveDeferred($item);
78117
}
79118

119+
/**
120+
* {@inheritdoc}
121+
*/
80122
public function commit()
81123
{
82-
// TODO: Implement commit() method.
124+
$this->cache->commit();
83125
}
84126

85127
/**

0 commit comments

Comments
 (0)