Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
49 | public function setCacheItem($key, $data, $ttl = 0) { |
||
50 | if ($this->hasCache()) { |
||
51 | $cacheItem = $this->getCache()->getItem($key); |
||
52 | $cacheItem->set($data); |
||
53 | if ($ttl > 0) { |
||
54 | $cacheItem->expiresAt(time()+$ttl); |
||
55 | } |
||
56 | return $this->getCache()->save($cacheItem); |
||
57 | } |
||
58 | return null; |
||
59 | } |
||
60 | |||
65 |