Implements Drupal\Core\KeyValueStore\KeyValueStoreInterface::getMultiple().
Overrides KeyValueStoreInterface::getMultiple
public function getMultiple(array $keys) {
$values = array();
try {
$result = $this->connection
->query('SELECT name, value FROM {' . $this->connection
->escapeTable($this->table) . '} WHERE name IN (:keys) AND collection = :collection', array(
':keys' => $keys,
':collection' => $this->collection,
))
->fetchAllAssoc('name');
foreach ($keys as $key) {
if (isset($result[$key])) {
$values[$key] = unserialize($result[$key]->value);
}
}
} catch (\Exception $e) {
// @todo: Perhaps if the database is never going to be available,
// key/value requests should return FALSE in order to allow exception
// handling to occur but for now, keep it an array, always.
}
return $values;
}