You are here

public function SplitCollectionStorage::__construct in Configuration Split 2.0.x

SplitCollectionStorage constructor.

Parameters

\Drupal\Core\Config\StorageInterface $storage: The storage onto which the collection is grafted.

string $name: The name of storage, must be a valid collection name.

string $collection: The collection name.

File

src/Config/SplitCollectionStorage.php, line 48

Class

SplitCollectionStorage
A config storage that lives in a collection of another config storage.

Namespace

Drupal\config_split\Config

Code

public function __construct(StorageInterface $storage, string $name, string $collection = StorageInterface::DEFAULT_COLLECTION) {
  $this->name = $name;
  $this->collection = $collection;
  $this->storage = $storage
    ->createCollection(static::PREFIX . $name . ($collection !== StorageInterface::DEFAULT_COLLECTION ? '.' . $collection : ''));
}