DefaultLanguageRenderer.php
Same filename in other branches
Namespace
Drupal\views\Entity\RenderFile
-
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();
}
/**
* {@inheritdoc}
*/
public function getLangcodeByRelationship(ResultRow $row, string $relationship = 'none') : string {
$entity = $this->getEntity($row, $relationship);
return $entity->getUntranslated()
->language()
->getId();
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
DefaultLanguageRenderer | Renders entities in their default language. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.