ConfigInstaller::getConfigToCreate

protected ConfigInstaller::getConfigToCreate(StorageInterface $storage, $collection, $prefix = '', array $profile_storages = [])

Gets configuration data from the provided storage to create.

Parameters

StorageInterface $storage: The configuration storage to read configuration from.

string $collection: The configuration collection to use.

string $prefix: (optional) Limit to configuration starting with the provided string.

\Drupal\Core\Config\StorageInterface[] $profile_storages: An array of storage interfaces containing profile configuration to check for overrides.

Return value

array An array of configuration data read from the source storage keyed by the configuration object name.

File

core/lib/Drupal/Core/Config/ConfigInstaller.php, line 241

Class

ConfigInstaller

Namespace

Drupal\Core\Config

Code

protected function getConfigToCreate(StorageInterface $storage, $collection, $prefix = '', array $profile_storages = []) {
  if ($storage->getCollectionName() != $collection) {
    $storage = $storage->createCollection($collection);
  }
  $data = $storage->readMultiple($storage->listAll($prefix));

  // Check to see if the corresponding override storage has any overrides.
  foreach ($profile_storages as $profile_storage) {
    if ($profile_storage->getCollectionName() != $collection) {
      $profile_storage = $profile_storage->createCollection($collection);
    }
    $data = $profile_storage->readMultiple(array_keys($data)) + $data;
  }
  return $data;
}
doc_Drupal
2016-10-29 08:53:53
Comments
Leave a Comment

Please login to continue.