public function EntityTranslationController::retranslate

Implements EntityTranslationControllerInterface::retranslate().

Overrides EntityTranslationControllerInterface::retranslate

1 call to EntityTranslationController::retranslate()
EntityTranslationController::entityFormEntityBuild in drupal/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php
Entity builder method.

File

drupal/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php, line 63
Definition of Drupal\translation_entity\EntityTranslationController.

Class

EntityTranslationController
Base class for entity translation controllers.

Namespace

Drupal\translation_entity

Code

public function retranslate(EntityInterface $entity, $langcode = NULL) {
  $updated_langcode = !empty($langcode) ? $langcode : $entity
    ->language()->langcode;
  $translations = $entity
    ->getTranslationLanguages();
  foreach ($translations as $langcode => $language) {
    $entity->retranslate[$langcode] = $langcode != $updated_langcode;
  }
}