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