function ContentTranslationHandler::retranslate

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

File

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

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.