You are here

protected function ConfigSplitEntityViewBuilder::listStorageContents in Configuration Split 2.0.x

List the contents of a storage.

Parameters

\Drupal\Core\Config\StorageInterface $storage: The storage.

Return value

array the contents.

1 call to ConfigSplitEntityViewBuilder::listStorageContents()
ConfigSplitEntityViewBuilder::viewMultiple in src/ConfigSplitEntityViewBuilder.php
Builds the render array for the provided entities.

File

src/ConfigSplitEntityViewBuilder.php, line 110

Class

ConfigSplitEntityViewBuilder
EntityViewBuilder for Config Split entities.

Namespace

Drupal\config_split

Code

protected function listStorageContents(StorageInterface $storage) : array {
  $list = $storage
    ->createCollection(StorageInterface::DEFAULT_COLLECTION)
    ->listAll();
  foreach ($storage
    ->getAllCollectionNames() as $collection) {
    foreach ($storage
      ->createCollection($collection)
      ->listAll() as $name) {
      $list[] = $collection . ':' . $name;
    }
  }
  return $list;
}