function CheckpointStorage::readMultiple

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

Overrides StorageInterface::readMultiple

1 call to CheckpointStorage::readMultiple()
CheckpointStorage::read in core/lib/Drupal/Core/Config/Checkpoint/CheckpointStorage.php
Reads configuration data from the storage.

File

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

Class

CheckpointStorage
Provides a config storage that can make checkpoints.

Namespace

Drupal\Core\Config\Checkpoint

Code

public function readMultiple(array $names) {
    if (count($this->checkpoints) === 0) {
        throw new NoCheckpointsException();
    }
    $return = [];
    foreach ($this->getCheckpointsToReadFrom() as $checkpoint) {
        $return = array_merge($return, $this->getKeyValue($checkpoint->id, $this->collection)
            ->getMultiple($names));
        // Remove the read names from the list to fetch.
        $names = array_diff($names, array_keys($return));
        if (empty($names)) {
            // All the configuration has been read. Nothing more to do.
            break;
        }
    }
    // Names not found in the checkpoints have not been modified: read from
    // active storage.
    if (!empty($names)) {
        $return = array_merge($return, $this->activeStorage
            ->readMultiple($names));
    }
    // Remove any renamed or new configuration (FALSE has been recorded for
    // these operations in the checkpoint).
    // @see ::onConfigRename()
    // @see ::onConfigSaveAndDelete()
    return array_filter($return);
}

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