function DefaultLanguageRenderer::getLangcodeByRelationship

Same name in other branches
  1. 10 core/modules/views/src/Entity/Render/DefaultLanguageRenderer.php \Drupal\views\Entity\Render\DefaultLanguageRenderer::getLangcodeByRelationship()

Overrides EntityTranslationRendererBase::getLangcodeByRelationship

File

core/modules/views/src/Entity/Render/DefaultLanguageRenderer.php, line 22

Class

DefaultLanguageRenderer
Renders entities in their default language.

Namespace

Drupal\views\Entity\Render

Code

public function getLangcodeByRelationship(ResultRow $row, string $relationship = 'none') : string {
    $entity = $this->getEntity($row, $relationship);
    return $entity->getUntranslated()
        ->language()
        ->getId();
}

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