Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TranslationLanguageRenderer.php

function TranslationLanguageRenderer::renderByRelationship

Overrides EntityTranslationRendererBase::renderByRelationship

File

core/modules/views/src/Entity/Render/TranslationLanguageRenderer.php, line 97

Class

TranslationLanguageRenderer
Renders entity translations in their row language.

Namespace

Drupal\views\Entity\Render

Code

public function renderByRelationship(ResultRow $row, string $relationship) : array {
    if ($entity = $this->getEntity($row, $relationship)) {
        $entity_id = $entity->id();
        return $this->build[$entity_id][$this->getLangcodeByRelationship($row, $relationship)];
    }
    return [];
}
RSS feed
Powered by Drupal