Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function save(CacheItemInterface $item)
 {
     $expiresInMinutes = null;
     if ($item instanceof CacheItem) {
         $expiresInMinutes = $item->getTTL();
     }
     try {
         if (is_null($expiresInMinutes)) {
             $this->repository->forever($item->getKey(), serialize($item->get()));
         } else {
             $this->repository->put($item->getKey(), serialize($item->get()), $expiresInMinutes);
         }
     } catch (Exception $exception) {
         return false;
     }
     return true;
 }