1 | <?php |
||
8 | class ResponseCacheRepository |
||
9 | { |
||
10 | /** @var \Illuminate\Cache\Repository */ |
||
11 | protected $cache; |
||
12 | |||
13 | /** @var \Spatie\ResponseCache\ResponseSerializer */ |
||
14 | protected $responseSerializer; |
||
15 | |||
16 | public function __construct(ResponseSerializer $responseSerializer, Repository $cache) |
||
21 | |||
22 | /** |
||
23 | * @param string $key |
||
24 | * @param \Symfony\Component\HttpFoundation\Response $response |
||
25 | * @param \DateTime|int $seconds |
||
26 | */ |
||
27 | public function put(string $key, $response, $seconds): void |
||
31 | |||
32 | public function putKey(string $key, $value, $seconds): void |
||
33 | { |
||
34 | $this->cache->put($key, $value, $seconds); |
||
35 | } |
||
36 | |||
37 | public function has(string $key): bool |
||
41 | |||
42 | public function get(string $key): Response |
||
46 | |||
47 | public function getKey(string $key): string |
||
48 | { |
||
49 | return $this->cache->get($key, ''); |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @deprecated Use the new clear method, this is just an alias. |
||
54 | */ |
||
55 | public function flush() |
||
59 | |||
60 | public function clear() |
||
64 | |||
65 | public function forget(string $key): bool |
||
69 | } |
||
70 |