Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Config/FileStorage.php \Drupal\Core\Config\FileStorage::getAllCollectionNames()
  2. 9 core/lib/Drupal/Core/Config/FileStorage.php \Drupal\Core\Config\FileStorage::getAllCollectionNames()

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

core/lib/Drupal/Core/Config/FileStorage.php, line 275

Class

FileStorage
Defines the file storage.

Namespace

Drupal\Core\Config

Code

public function getAllCollectionNames() {
  if (!is_dir($this->directory)) {
    return [];
  }
  $collections = $this
    ->getAllCollectionNamesHelper($this->directory);
  sort($collections);
  return $collections;
}