You are here

public function MongodbConfigStorage::read in MongoDB 8

Reads configuration data from the storage.

Parameters

string $name: The name of a configuration object to load.

Return value

array|bool The configuration data stored for the configuration object name. If no configuration data exists for the given name, FALSE is returned.

Overrides StorageInterface::read

1 call to MongodbConfigStorage::read()
MongodbConfigStorageBootstrap::read in src/MongodbConfigStorageBootstrap.php
Reads configuration data from the storage.
1 method overrides MongodbConfigStorage::read()
MongodbConfigStorageBootstrap::read in src/MongodbConfigStorageBootstrap.php
Reads configuration data from the storage.

File

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

Class

MongodbConfigStorage

Namespace

Drupal\mongodb

Code

public function read($name) {
  $result = $this
    ->mongoCollection()
    ->findOne(array(
    '_id' => $name,
  ));
  if (empty($result)) {
    return FALSE;
  }
  unset($result['_id']);
  return $result;
}