| 1 | <?php |
||
| 14 | class DoctrineCache implements CacheInterface |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var Cache |
||
| 18 | */ |
||
| 19 | private $doctrineCache; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | private $cachePrefix = ''; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param Cache $doctrineCache |
||
| 28 | */ |
||
| 29 | 6 | public function __construct( |
|
| 30 | Cache $doctrineCache, |
||
| 31 | $cachePrefix |
||
| 32 | ) { |
||
| 33 | 6 | $this->doctrineCache = $doctrineCache; |
|
| 34 | 6 | $this->cachePrefix = substr( |
|
| 35 | 6 | md5($cachePrefix), |
|
| 36 | 6 | 0, |
|
| 37 | 6 | 6 |
|
| 38 | 6 | ) . '.'; |
|
| 39 | 6 | } |
|
| 40 | |||
| 41 | /** |
||
| 42 | * @param string $key |
||
| 43 | * @param mixed $value |
||
| 44 | * @param int $ttl |
||
| 45 | * @return bool |
||
| 46 | */ |
||
| 47 | 2 | public function set($key, $value, $ttl = 0) |
|
| 51 | |||
| 52 | /** |
||
| 53 | * @param string $key |
||
| 54 | * @return mixed|null |
||
| 55 | */ |
||
| 56 | 2 | public function get($key) |
|
| 63 | |||
| 64 | /** |
||
| 65 | * @param string $key |
||
| 66 | * @return bool |
||
| 67 | */ |
||
| 68 | 2 | public function delete($key) |
|
| 72 | } |
||
| 73 |