You are here

public function ConfigSnapshotStorage::getAllCollectionNames in Config Snapshot 8

Gets the existing collections.

A configuration storage can contain multiple sets of configuration objects in partitioned collections. The collection key name identifies the current collection used.

Return value

array An array of existing collection names.

Overrides StorageInterface::getAllCollectionNames

File

src/ConfigSnapshotStorage.php, line 252

Class

ConfigSnapshotStorage
Provides a configuration storage saved as simple configuration.

Namespace

Drupal\config_snapshot

Code

public function getAllCollectionNames() {
  $items = $this->configSnapshot
    ->getItems();
  $collections = array_unique(array_column($items, 'collection'));

  // The default collection is not included here.
  unset($collections[array_search(StorageInterface::DEFAULT_COLLECTION, $collections)]);
  return array_values($collections);
}