function CheckpointStorage::getKeyValue

Same name in other branches
  1. 10 core/lib/Drupal/Core/Config/Checkpoint/CheckpointStorage.php \Drupal\Core\Config\Checkpoint\CheckpointStorage::getKeyValue()

Gets the key value storage for the provided checkpoint.

Parameters

string $checkpoint: The checkpoint to get the key value storage for.

string $collection: The config collection to get the key value storage for.

Return value

\Drupal\Core\KeyValueStore\KeyValueStoreInterface The key value storage for the provided checkpoint.

3 calls to CheckpointStorage::getKeyValue()
CheckpointStorage::onConfigRename in core/lib/Drupal/Core/Config/Checkpoint/CheckpointStorage.php
Updates checkpoint when configuration is saved.
CheckpointStorage::onConfigSaveAndDelete in core/lib/Drupal/Core/Config/Checkpoint/CheckpointStorage.php
Updates checkpoint when configuration is saved.
CheckpointStorage::storeCollectionName in core/lib/Drupal/Core/Config/Checkpoint/CheckpointStorage.php
Stores the collection name so the storage knows its own collections.

File

core/lib/Drupal/Core/Config/Checkpoint/CheckpointStorage.php, line 312

Class

CheckpointStorage
Provides a config storage that can make checkpoints.

Namespace

Drupal\Core\Config\Checkpoint

Code

private function getKeyValue(string $checkpoint, string $collection) : KeyValueStoreInterface {
    $checkpoint_key = $checkpoint;
    if ($collection !== StorageInterface::DEFAULT_COLLECTION) {
        $checkpoint_key = $collection . '.' . $checkpoint_key;
    }
    return $this->keyValueStores[$checkpoint_key] ??= $this->keyValueFactory
        ->get(self::KEY_VALUE_COLLECTION_PREFIX . $checkpoint_key);
}

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