1 | <?php |
||
7 | class CacheItem implements CacheItemInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var |
||
11 | */ |
||
12 | private $key; |
||
13 | /** |
||
14 | * @var |
||
15 | */ |
||
16 | private $value; |
||
17 | /** |
||
18 | * @var int |
||
19 | */ |
||
20 | private $expiresAfter; |
||
21 | |||
22 | /** |
||
23 | * @param $key |
||
24 | * The cache item key. |
||
25 | * |
||
26 | * @param $value |
||
27 | * The value to cache. |
||
28 | * |
||
29 | * @param int $expiresAfter |
||
30 | * The period of time from the present after which the item MUST be considered |
||
31 | * expired. An integer parameter is understood to be the time in seconds until |
||
32 | * expiration. |
||
33 | */ |
||
34 | public function __construct($key, $value, $expiresAfter) |
||
41 | |||
42 | /** |
||
43 | * @inheritdoc |
||
44 | */ |
||
45 | public function getKey() |
||
49 | |||
50 | /** |
||
51 | * @inheritdoc |
||
52 | */ |
||
53 | public function get() |
||
57 | |||
58 | /** |
||
59 | * @inheritdoc |
||
60 | */ |
||
61 | public function isHit() |
||
65 | |||
66 | /** |
||
67 | * @inheritdoc |
||
68 | */ |
||
69 | public function set($value) |
||
73 | |||
74 | /** |
||
75 | * @inheritdoc |
||
76 | */ |
||
77 | public function expiresAt($expiration) |
||
81 | |||
82 | /** |
||
83 | * @inheritdoc |
||
84 | */ |
||
85 | public function expiresAfter($time) |
||
89 | } |