function StorageReplaceDataWrapper::__construct

Same name in other branches
  1. 9 core/modules/config/src/StorageReplaceDataWrapper.php \Drupal\config\StorageReplaceDataWrapper::__construct()
  2. 8.9.x core/modules/config/src/StorageReplaceDataWrapper.php \Drupal\config\StorageReplaceDataWrapper::__construct()
  3. 10 core/modules/config/src/StorageReplaceDataWrapper.php \Drupal\config\StorageReplaceDataWrapper::__construct()

Constructs a new StorageReplaceDataWrapper.

Parameters

\Drupal\Core\Config\StorageInterface $storage: A configuration storage to be used to read and write configuration.

string $collection: (optional) The collection to store configuration in. Defaults to the default collection.

File

core/modules/config/src/StorageReplaceDataWrapper.php, line 44

Class

StorageReplaceDataWrapper
Wraps a configuration storage to allow replacing specific configuration data.

Namespace

Drupal\config

Code

public function __construct(StorageInterface $storage, $collection = StorageInterface::DEFAULT_COLLECTION) {
    $this->storage = $storage;
    $this->collection = $collection;
    $this->replacementData[$collection] = [];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.