You are here

DefaultLanguageRenderer.php in Drupal 10

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.