You are here

public function MongodbConfigStorage::readMultiple in MongoDB 8

Reads configuration data from the storage.

Parameters

array $names: List of names of the configuration objects to load.

Return value

array A list of the configuration data stored for the configuration object name that could be loaded for the passed list of names.

Overrides StorageInterface::readMultiple

File

src/MongodbConfigStorage.php, line 72
Definition of Drupal\mongodb\Config\MongoStorage.

Class

MongodbConfigStorage

Namespace

Drupal\mongodb

Code

public function readMultiple(array $names) {
  $data = $this
    ->mongoCollection()
    ->find(array(
    '_id' => array(
      '$in' => array_values($names),
    ),
  ));
  $list = array();
  foreach ($data as $item) {
    $list[$item['_id']] = $item;
    unset($list[$item['_id']]['_id']);
  }
  return $list;
}