예제 #1
0
 /**
  * Loads the cache entries from the given backend using the given storageId.
  *
  * @param Backend $storage
  * @param $storageId
  */
 public function __construct(Backend $storage, $storageId)
 {
     $this->storage = $storage;
     $this->storageId = $storageId;
     $content = $storage->doFetch($storageId);
     if (is_array($content)) {
         $this->content = $content;
     }
 }
예제 #2
0
 /**
  * Fetches an entry from the cache.
  *
  * Make sure to call the method {@link has()} to verify whether there is actually any content set under this
  * cache id.
  *
  * @param string $id The cache id.
  * @return mixed
  */
 public function fetch($id)
 {
     return $this->backend->doFetch($id);
 }