Пример #1
0
 /**
  * Will persist all previously made changes if there were any.
  *
  * @param int $lifeTime  The cache lifetime in seconds.
  *                       If != 0, sets a specific lifetime for this cache entry (0 => infinite lifeTime).
  */
 public function persistCacheIfNeeded($lifeTime)
 {
     if ($this->isDirty) {
         $this->storage->doSave($this->storageId, $this->content, $lifeTime);
     }
 }
Пример #2
0
 /**
  * Puts data into the cache.
  *
  * @param string $id The cache id.
  * @param mixed $content
  * @param int $lifeTime Setting a lifetime is not supported by this cache and the parameter will be ignored.
  * @return boolean
  */
 public function save($id, $content, $lifeTime = 0)
 {
     return $this->backend->doSave($id, $content);
 }