function LocaleConfigManager::getComponentNames

Same name and namespace in other branches
  1. 9 core/modules/locale/src/LocaleConfigManager.php \Drupal\locale\LocaleConfigManager::getComponentNames()
  2. 8.9.x core/modules/locale/src/LocaleConfigManager.php \Drupal\locale\LocaleConfigManager::getComponentNames()
  3. 10 core/modules/locale/src/LocaleConfigManager.php \Drupal\locale\LocaleConfigManager::getComponentNames()

Gets configuration names associated with components.

Parameters

array $components: (optional) An associative array containing component types as keys and lists of components as values. If not provided or is empty, the method returns all configuration names.

Return value

array Array of configuration object names.

1 call to LocaleConfigManager::getComponentNames()
LocaleConfigManager::updateDefaultConfigLangcodes in core/modules/locale/src/LocaleConfigManager.php
Updates default configuration when new modules or themes are installed.

File

core/modules/locale/src/LocaleConfigManager.php, line 299

Class

LocaleConfigManager
Manages configuration supported in part by interface translation.

Namespace

Drupal\locale

Code

public function getComponentNames(array $components = []) {
  $components = array_filter($components);
  if ($components) {
    $names = [];
    foreach ($components as $type => $list) {
      // InstallStorage::getComponentNames returns a list of folders keyed by
      // config name.
      $names = array_merge($names, $this->defaultConfigStorage
        ->getComponentNames($type, $list));
    }
    return $names;
  }
  else {
    return $this->defaultConfigStorage
      ->listAll();
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.