You are here

public function MongodbConfigStorage::__construct in MongoDB 8

Constructs a new ConfigStorage controller.

Parameters

MongoCollectionFactory $mongo: The object wrapping the MongoDB database object.

string $collection: Name of the config collection.

1 call to MongodbConfigStorage::__construct()
MongodbConfigStorageBootstrap::__construct in src/MongodbConfigStorageBootstrap.php
Constructs a new ConfigStorage controller.
1 method overrides MongodbConfigStorage::__construct()
MongodbConfigStorageBootstrap::__construct in src/MongodbConfigStorageBootstrap.php
Constructs a new ConfigStorage controller.

File

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

Class

MongodbConfigStorage

Namespace

Drupal\mongodb

Code

public function __construct(MongoCollectionFactory $mongo, $prefix = 'config', $collection = StorageInterface::DEFAULT_COLLECTION) {
  $this->mongo = $mongo;
  $this->prefix = $prefix;
  $this->mongoCollectionName = $prefix . ($collection ?: '');
}