You are here

class CurrentLanguageRenderer in Display Suite 8.3

Same name and namespace in other branches
  1. 8.4 src/Plugin/views/Entity/Render/CurrentLanguageRenderer.php \Drupal\ds\Plugin\views\Entity\Render\CurrentLanguageRenderer
  2. 8.2 src/Plugin/views/Entity/Render/CurrentLanguageRenderer.php \Drupal\ds\Plugin\views\Entity\Render\CurrentLanguageRenderer

Renders entities in the current language.

Hierarchy

Expanded class hierarchy of CurrentLanguageRenderer

File

src/Plugin/views/Entity/Render/CurrentLanguageRenderer.php, line 10

Namespace

Drupal\ds\Plugin\views\Entity\Render
View source
class CurrentLanguageRenderer extends RendererBase {

  /**
   * Returns NULL so that the current language is used.
   *
   * @param \Drupal\views\ResultRow $row
   *   The result row.
   *
   * @return string
   */
  public function getLangcode(ResultRow $row) {
    return $this->languageManager
      ->getCurrentLanguage()
      ->getId();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CurrentLanguageRenderer::getLangcode public function Returns NULL so that the current language is used. Overrides EntityTranslationRendererBase::getLangcode
EntityTranslationRendererBase::query public function Alters the query if needed. Overrides RendererBase::query 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::alterBuild protected function Alter the build.
RendererBase::dsPreRender protected function Pre renders all the Display Suite rows.
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::preRender public function Runs before each entity is rendered. Overrides EntityTranslationRendererBase::preRender 1
RendererBase::render public function Renders entity data. Overrides EntityTranslationRendererBase::render 1
RendererBase::__construct public function Constructs a renderer object. 2