| 1 | <?php |
||
| 10 | class NamespaceAdapter implements CacheAdapterInterface |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var CacheAdapterInterface |
||
| 14 | */ |
||
| 15 | private $cache; |
||
| 16 | /** |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | private $nsName; |
||
| 20 | /** |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | private $separator; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param CacheAdapterInterface $cache |
||
| 27 | * @param $nsName |
||
| 28 | * @param string $separator |
||
| 29 | */ |
||
| 30 | public function __construct(CacheAdapterInterface $cache, $nsName, $separator = '.') |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param $key |
||
| 39 | * @return mixed|null |
||
| 40 | */ |
||
| 41 | public function get($key) |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @param $key |
||
| 48 | * @param $value |
||
| 49 | */ |
||
| 50 | public function set($key, $value) |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param $key |
||
| 57 | */ |
||
| 58 | public function delete($key) |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @param $key |
||
| 65 | * @return string |
||
| 66 | */ |
||
| 67 | private function getKey($key) |
||
| 71 | } |
||
| 72 |