Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ContentEntityBase.php

function 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 799

Class

ContentEntityBase
Implements Entity Field API specific enhancements to the Entity class.

Namespace

Drupal\Core\Entity

Code

protected function updateFieldLangcodes($langcode) {
    foreach ($this->fields as $items) {
        if (!empty($items[LanguageInterface::LANGCODE_DEFAULT])) {
            $items[LanguageInterface::LANGCODE_DEFAULT]->setLangcode($langcode);
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal