function EntityTranslationRenderTrait::getEntityTranslation

Same name in other branches
  1. 9 core/modules/views/src/Entity/Render/EntityTranslationRenderTrait.php \Drupal\views\Entity\Render\EntityTranslationRenderTrait::getEntityTranslation()
  2. 8.9.x core/modules/views/src/Entity/Render/EntityTranslationRenderTrait.php \Drupal\views\Entity\Render\EntityTranslationRenderTrait::getEntityTranslation()

Returns the entity translation matching the configured row language.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity object the field value being processed is attached to.

\Drupal\views\ResultRow $row: The result row the field value being processed belongs to.

Return value

\Drupal\Core\Entity\FieldableEntityInterface The entity translation object for the specified row.

Deprecated

in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\views\Entity\Render\EntityTranslationRenderTrait::getEntityTranslationByRelationship instead.

See also

https://www.drupal.org/node/3311862

File

core/modules/views/src/Entity/Render/EntityTranslationRenderTrait.php, line 74

Class

EntityTranslationRenderTrait
Trait used to instantiate the view's entity translation renderer.

Namespace

Drupal\views\Entity\Render

Code

public function getEntityTranslation(EntityInterface $entity, ResultRow $row) {
    @trigger_error('\\Drupal\\views\\Entity\\Render\\EntityTranslationRenderTrait::getEntityTranslation is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \\Drupal\\views\\Entity\\Render\\EntityTranslationRenderTrait::getEntityTranslationByRelationship instead. See https://www.drupal.org/node/3311862', E_USER_DEPRECATED);
    return $this->getEntityTranslationByRelationship($entity, $row);
}

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