function ConfigMapperManager::findTranslatable
Same name in other branches
- 9 core/modules/config_translation/src/ConfigMapperManager.php \Drupal\config_translation\ConfigMapperManager::findTranslatable()
- 8.9.x core/modules/config_translation/src/ConfigMapperManager.php \Drupal\config_translation\ConfigMapperManager::findTranslatable()
- 11.x core/modules/config_translation/src/ConfigMapperManager.php \Drupal\config_translation\ConfigMapperManager::findTranslatable()
Returns TRUE if at least one translatable element is found.
Parameters
\Drupal\Core\TypedData\TypedDataInterface $element: Configuration schema element.
Return value
bool A boolean indicating if there is at least one translatable element.
1 call to ConfigMapperManager::findTranslatable()
- ConfigMapperManager::hasTranslatable in core/
modules/ config_translation/ src/ ConfigMapperManager.php
File
-
core/
modules/ config_translation/ src/ ConfigMapperManager.php, line 189
Class
- ConfigMapperManager
- Manages plugins for configuration translation mappers.
Namespace
Drupal\config_translationCode
protected function findTranslatable(TypedDataInterface $element) {
// In case this is a sequence or a mapping check whether any child element
// is translatable.
if ($element instanceof TraversableTypedDataInterface) {
foreach ($element as $child_element) {
if ($this->findTranslatable($child_element)) {
return TRUE;
}
}
// If none of the child elements are translatable, return FALSE.
return FALSE;
}
else {
$definition = $element->getDataDefinition();
return isset($definition['translatable']) && $definition['translatable'];
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.