public function ConfigNamesMapper::getLangcode in Drupal 10
Same name and namespace in other branches
- 8 core/modules/config_translation/src/ConfigNamesMapper.php \Drupal\config_translation\ConfigNamesMapper::getLangcode()
- 9 core/modules/config_translation/src/ConfigNamesMapper.php \Drupal\config_translation\ConfigNamesMapper::getLangcode()
File
- core/
modules/ config_translation/ src/ ConfigNamesMapper.php, line 400
Class
- ConfigNamesMapper
- Configuration mapper base implementation.
Namespace
Drupal\config_translationCode
public function getLangcode() {
$langcodes = array_map([
$this,
'getLangcodeFromConfig',
], $this
->getConfigNames());
if (count(array_unique($langcodes)) > 1) {
throw new ConfigMapperLanguageException('A config mapper can only contain configuration for a single language.');
}
return reset($langcodes);
}