class DefaultLanguageRenderer

Same name in other branches
  1. 8.9.x core/modules/views/src/Entity/Render/DefaultLanguageRenderer.php \Drupal\views\Entity\Render\DefaultLanguageRenderer
  2. 10 core/modules/views/src/Entity/Render/DefaultLanguageRenderer.php \Drupal\views\Entity\Render\DefaultLanguageRenderer
  3. 11.x core/modules/views/src/Entity/Render/DefaultLanguageRenderer.php \Drupal\views\Entity\Render\DefaultLanguageRenderer

Renders entities in their default language.

Hierarchy

Expanded class hierarchy of DefaultLanguageRenderer

1 string reference to 'DefaultLanguageRenderer'
EntityTranslationRenderTrait::getEntityTranslationRenderer in core/modules/views/src/Entity/Render/EntityTranslationRenderTrait.php
Returns the current renderer.

File

core/modules/views/src/Entity/Render/DefaultLanguageRenderer.php, line 10

Namespace

Drupal\views\Entity\Render
View source
class DefaultLanguageRenderer extends EntityTranslationRendererBase {
    
    /**
     * {@inheritdoc}
     */
    public function getLangcode(ResultRow $row) {
        return $row->_entity
            ->getUntranslated()
            ->language()
            ->getId();
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
DefaultLanguageRenderer::getLangcode public function Returns the language code associated with the given row. Overrides EntityTranslationRendererBase::getLangcode
EntityTranslationRendererBase::preRender public function Runs before each entity is rendered. Overrides RendererBase::preRender 1
EntityTranslationRendererBase::query public function Alters the query if needed. Overrides RendererBase::query 1
EntityTranslationRendererBase::render public function Renders entity data. Overrides RendererBase::render 1
RendererBase::$build protected property Contains an array of render arrays, one for each rendered entity.
RendererBase::$entityType protected property The type of the entity being rendered.
RendererBase::$languageManager protected property The language manager.
RendererBase::$view public property The view executable wrapping the view storage entity.
RendererBase::getCacheContexts public function The cache contexts associated with this object. Overrides CacheableDependencyInterface::getCacheContexts 2
RendererBase::getCacheMaxAge public function The maximum age for which this object may be cached. Overrides CacheableDependencyInterface::getCacheMaxAge
RendererBase::getCacheTags public function The cache tags associated with this object. Overrides CacheableDependencyInterface::getCacheTags
RendererBase::__construct public function Constructs a renderer object. 2

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.