public function Redis_Cache_Predis::getMultiple in Redis 7.3
Same name and namespace in other branches
- 7 lib/Redis/Cache/Predis.php \Redis_Cache_Predis::getMultiple()
- 7.2 lib/Redis/Cache/Predis.php \Redis_Cache_Predis::getMultiple()
File
- lib/Redis/Cache/Predis.php, line 59
Class
- Redis_Cache_Predis
- Predis cache backend.
Code
public function getMultiple(array $idList) {
$ret = array();
$pipe = $this
->getClient()
->pipeline();
foreach ($idList as $id) {
$pipe
->hgetall($this
->getKey($id));
}
$replies = $pipe
->execute();
foreach (array_values($idList) as $line => $id) {
if (!empty($replies[$line]) && is_array($replies[$line])) {
$ret[$id] = $replies[$line];
}
}
return $ret;
}