protected function PredisCache::doSave in Plug 7
Puts data into the cache.
Parameters
string $id The cache id.:
string $data The cache entry/data.:
int $lifeTime The lifetime. If != 0, sets a specific lifetime for this: cache entry (0 => infinite lifeTime).
Return value
boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise.
Overrides CacheProvider::doSave
File
- lib/
doctrine/ cache/ lib/ Doctrine/ Common/ Cache/ PredisCache.php, line 62
Class
- PredisCache
- Predis cache provider.
Namespace
Doctrine\Common\CacheCode
protected function doSave($id, $data, $lifeTime = 0) {
if ($lifeTime > 0) {
$response = $this->client
->setex($id, $lifeTime, $data);
}
else {
$response = $this->client
->set($id, $data);
}
return $response === true || $response == 'OK';
}