function ContentEntityBase::updateFieldLangcodes
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::updateFieldLangcodes()
- 8.9.x core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::updateFieldLangcodes()
- 11.x core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::updateFieldLangcodes()
Updates language for already instantiated fields.
1 call to ContentEntityBase::updateFieldLangcodes()
- ContentEntityBase::onChange in core/
lib/ Drupal/ Core/ Entity/ ContentEntityBase.php
File
-
core/
lib/ Drupal/ Core/ Entity/ ContentEntityBase.php, line 800
Class
- ContentEntityBase
- Implements Entity Field API specific enhancements to the Entity class.
Namespace
Drupal\Core\EntityCode
protected function updateFieldLangcodes($langcode) {
foreach ($this->fields as $items) {
if (!empty($items[LanguageInterface::LANGCODE_DEFAULT])) {
$items[LanguageInterface::LANGCODE_DEFAULT]->setLangcode($langcode);
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.