function ContentTranslationHandler::retranslate

Same name in other branches
  1. 9 core/modules/content_translation/src/ContentTranslationHandler.php \Drupal\content_translation\ContentTranslationHandler::retranslate()
  2. 8.9.x core/modules/content_translation/src/ContentTranslationHandler.php \Drupal\content_translation\ContentTranslationHandler::retranslate()
  3. 11.x core/modules/content_translation/src/ContentTranslationHandler.php \Drupal\content_translation\ContentTranslationHandler::retranslate()

Overrides ContentTranslationHandlerInterface::retranslate

1 call to ContentTranslationHandler::retranslate()
ContentTranslationHandler::entityFormEntityBuild in core/modules/content_translation/src/ContentTranslationHandler.php
Entity builder method.

File

core/modules/content_translation/src/ContentTranslationHandler.php, line 304

Class

ContentTranslationHandler
Base class for content translation handlers.

Namespace

Drupal\content_translation

Code

public function retranslate(EntityInterface $entity, $langcode = NULL) {
    $updated_langcode = !empty($langcode) ? $langcode : $entity->language()
        ->getId();
    foreach ($entity->getTranslationLanguages() as $langcode => $language) {
        $this->manager
            ->getTranslationMetadata($entity->getTranslation($langcode))
            ->setOutdated($langcode != $updated_langcode);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.