| 1 | <?php |
||
| 11 | class CacheBackend implements BackendInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Cache to use as a storage |
||
| 15 | * |
||
| 16 | * @var Cache |
||
| 17 | */ |
||
| 18 | private $cache; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Load information by given key from storage |
||
| 22 | * |
||
| 23 | * @param string $key |
||
| 24 | * @return mixed |
||
| 25 | */ |
||
| 26 | 1 | public function load($key) |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Get cache to use as storage |
||
| 37 | * |
||
| 38 | * @return Cache |
||
| 39 | */ |
||
| 40 | 1 | protected function getCache() |
|
| 47 | |||
| 48 | /** |
||
| 49 | * Save given contents into storage |
||
| 50 | * |
||
| 51 | * @param string $key |
||
| 52 | * @param mixed $contents |
||
| 53 | * @return void |
||
| 54 | */ |
||
| 55 | 1 | public function save($key, $contents) |
|
| 59 | |||
| 60 | /** |
||
| 61 | * Check if storage has an entry with given key |
||
| 62 | * |
||
| 63 | * @param string $key |
||
| 64 | * @return boolean |
||
| 65 | */ |
||
| 66 | 1 | public function has($key) |
|
| 70 | |||
| 71 | /** |
||
| 72 | * Remove storage entry with given key |
||
| 73 | * |
||
| 74 | * @param string $key |
||
| 75 | * @return void |
||
| 76 | */ |
||
| 77 | 1 | public function remove($key) |
|
| 81 | |||
| 82 | /** |
||
| 83 | * Clear storage contents |
||
| 84 | * |
||
| 85 | * @return void |
||
| 86 | */ |
||
| 87 | public function clear() |
||
| 91 | } |
||
| 92 |