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

Breadcrumb

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

function 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();
}
RSS feed
Powered by Drupal