/** * @param array $keys * * @return array */ public function getMulti(array $keys) { if (count($keys) === 0) { return $keys; } $transformedKeys = []; foreach ($keys as $key) { $transformedKeys[] = $this->getKeyName($key); } $values = array_combine($transformedKeys, $this->client->mget($transformedKeys)); $this->addMultiReadAccessStats($keys); return $values; }
/** * @group redis-strings */ public function testMultipleGet() { $this->client->mset(array('foo' => 'bar', 'hello' => 'world')); $this->assertEquals(array('bar', 'world'), $this->client->mget('foo', 'hello')); }