function ConfigurableLanguageManager::loadLanguageTypesConfiguration

Same name in other branches
  1. 9 core/modules/language/src/ConfigurableLanguageManager.php \Drupal\language\ConfigurableLanguageManager::loadLanguageTypesConfiguration()
  2. 10 core/modules/language/src/ConfigurableLanguageManager.php \Drupal\language\ConfigurableLanguageManager::loadLanguageTypesConfiguration()
  3. 11.x core/modules/language/src/ConfigurableLanguageManager.php \Drupal\language\ConfigurableLanguageManager::loadLanguageTypesConfiguration()

Retrieves language types from the configuration storage.

Return value

array An array of language type names.

2 calls to ConfigurableLanguageManager::loadLanguageTypesConfiguration()
ConfigurableLanguageManager::getDefinedLanguageTypes in core/modules/language/src/ConfigurableLanguageManager.php
Returns all the defined language types including fixed ones.
ConfigurableLanguageManager::getLanguageTypes in core/modules/language/src/ConfigurableLanguageManager.php
Returns an array of the available language types.

File

core/modules/language/src/ConfigurableLanguageManager.php, line 169

Class

ConfigurableLanguageManager
Overrides default LanguageManager to provide configured languages.

Namespace

Drupal\language

Code

protected function loadLanguageTypesConfiguration() {
    if (!$this->languageTypes) {
        $this->languageTypes = $this->configFactory
            ->get('language.types')
            ->get() ?: [
            'configurable' => [],
            'all' => parent::getLanguageTypes(),
        ];
    }
    return $this->languageTypes;
}

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