protected function MongoDBCache::doFetch in Plug 7
Fetches an entry from the cache.
Parameters
string $id The id of the cache entry to fetch.:
Return value
string|boolean The cached data or FALSE, if no cache entry exists for the given id.
Overrides CacheProvider::doFetch
File
- lib/
doctrine/ cache/ lib/ Doctrine/ Common/ Cache/ MongoDBCache.php, line 82
Class
- MongoDBCache
- MongoDB cache provider.
Namespace
Doctrine\Common\CacheCode
protected function doFetch($id) {
$document = $this->collection
->findOne(array(
'_id' => $id,
), array(
self::DATA_FIELD,
self::EXPIRATION_FIELD,
));
if ($document === null) {
return false;
}
if ($this
->isExpired($document)) {
$this
->doDelete($id);
return false;
}
return unserialize($document[self::DATA_FIELD]->bin);
}