function CheckpointStorage::readMultiple

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

Reads configuration data from the storage.

Parameters

array $names: List of names of the configuration objects to load.

Return value

array A list of the configuration data stored for the configuration object name that could be loaded for the passed list of names.

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.