collections[$collection] = $override_service; } /** * Gets the list of possible collection names. * * @param bool $include_default * (Optional) Include the default collection. Defaults to TRUE. * * @return array * The list of possible collection names. */ public function getCollectionNames($include_default = TRUE) { $collection_names = array_keys($this->collections); sort($collection_names); if ($include_default) { array_unshift($collection_names, StorageInterface::DEFAULT_COLLECTION); } return $collection_names; } /** * Gets the config factory override service responsible for the collection. * * @param string $collection * The configuration collection. * * @return \Drupal\Core\Config\ConfigFactoryOverrideInterface|null * The override service responsible for the collection if one exists. NULL * if not. */ public function getOverrideService($collection) { return $this->collections[$collection] ?? NULL; } }