Skip to content

Commit 910fca3

Browse files
committed
Improved the getMultiple behavior, so it is transparent from client point of view.
1 parent 6878b25 commit 910fca3

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

PrefixedSimpleCache.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,18 @@ public function get($key, $default = null)
105105
*/
106106
public function getMultiple($keys, $default = null)
107107
{
108+
$oldKeys = $keys;
108109
$this->prefixValues($keys);
110+
$keysMap = array_combine($keys, $oldKeys);
109111

110-
return $this->cache->getMultiple($keys, $default);
112+
$data = $this->cache->getMultiple($keys, $default);
113+
114+
// As ordering is configraution dependent, we are remapping the results.
115+
$result = [];
116+
foreach ($data as $key => $value) {
117+
$result[$keysMap[$key]] = $value;
118+
}
119+
return $result;
111120
}
112121

113122
/**

0 commit comments

Comments
 (0)