function ContentTranslationManager::getTranslationMetadata

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

File

core/modules/content_translation/src/ContentTranslationManager.php, line 52

Class

ContentTranslationManager
Provides common functionality for content translation.

Namespace

Drupal\content_translation

Code

public function getTranslationMetadata(EntityInterface $translation) {
    // We need a new instance of the metadata handler wrapping each translation.
    $entity_type = $translation->getEntityType();
    $class = $entity_type->get('content_translation_metadata');
    return new $class($translation, $this->getTranslationHandler($entity_type->id()));
}

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