|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +namespace CleverAge\CacheProcessBundle\Adapter; |
| 6 | + |
| 7 | +use Psr\Cache\CacheItemInterface; |
| 8 | +use Symfony\Component\Cache\CacheItem; |
| 9 | + |
| 10 | +class Adapter implements AdapterInterface |
| 11 | +{ |
| 12 | + public function __construct( |
| 13 | + private readonly \Symfony\Component\Cache\Adapter\AdapterInterface $adapter, |
| 14 | + private readonly string $code, |
| 15 | + ) {} |
| 16 | + |
| 17 | + public function getCode(): string |
| 18 | + { |
| 19 | + return $this->code; |
| 20 | + } |
| 21 | + |
| 22 | + public function getItem(mixed $key): CacheItem |
| 23 | + { |
| 24 | + return $this->adapter->getItem($key); |
| 25 | + } |
| 26 | + |
| 27 | + public function getItems(array $keys = []): iterable |
| 28 | + { |
| 29 | + return $this->adapter->getItems($keys); |
| 30 | + } |
| 31 | + |
| 32 | + public function clear(string $prefix = ''): bool |
| 33 | + { |
| 34 | + return $this->adapter->clear($prefix); |
| 35 | + } |
| 36 | + |
| 37 | + public function hasItem(string $key): bool |
| 38 | + { |
| 39 | + return $this->adapter->hasItem($key); |
| 40 | + } |
| 41 | + |
| 42 | + public function deleteItem(string $key): bool |
| 43 | + { |
| 44 | + return $this->adapter->deleteItem($key); |
| 45 | + } |
| 46 | + |
| 47 | + public function deleteItems(array $keys): bool |
| 48 | + { |
| 49 | + return $this->adapter->deleteItems($keys); |
| 50 | + } |
| 51 | + |
| 52 | + public function save(CacheItemInterface $item): bool |
| 53 | + { |
| 54 | + return $this->adapter->save($item); |
| 55 | + } |
| 56 | + |
| 57 | + public function saveDeferred(CacheItemInterface $item): bool |
| 58 | + { |
| 59 | + return $this->adapter->saveDeferred($item); |
| 60 | + } |
| 61 | + |
| 62 | + public function commit(): bool |
| 63 | + { |
| 64 | + return $this->adapter->commit(); |
| 65 | + } |
| 66 | +} |
0 commit comments