You are here

DefaultLanguageRenderer.php in Zircon Profile 8.0

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

/**
 * @file
 * Contains \Drupal\views\Entity\Render\DefaultLanguageRenderer.
 */
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.