You are here

DefaultLanguageRenderer.php in Drupal 9

Same filename and directory in other branches
  1. 8 core/modules/views/src/Entity/Render/DefaultLanguageRenderer.php

File

core/modules/views/src/Entity/Render/DefaultLanguageRenderer.php
View source
<?php

namespace Drupal\views\Entity\Render;

use Drupal\views\ResultRow;

/**
 * Renders entities in their default language.
 */
class DefaultLanguageRenderer extends EntityTranslationRendererBase {

  /**
   * {@inheritdoc}
   */
  public function getLangcode(ResultRow $row) {
    return $row->_entity
      ->getUntranslated()
      ->language()
      ->getId();
  }

}

Classes

Namesort descending Description
DefaultLanguageRenderer Renders entities in their default language.