/** * 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; } }
/** * 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); }