You are here

public function MongodbConfigStorage::exists in MongoDB 8

Returns whether a configuration object exists.

Parameters

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

Return value

bool TRUE if the configuration object exists, FALSE otherwise.

Overrides StorageInterface::exists

File

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

Class

MongodbConfigStorage

Namespace

Drupal\mongodb

Code

public function exists($name) {
  return $this
    ->mongoCollection()
    ->count(array(
    '_id' => $name,
  )) ? TRUE : FALSE;
}