You are here

public function DefaultLanguageRenderer::getLangcode in Display Suite 8.4

Same name and namespace in other branches
  1. 8.2 src/Plugin/views/Entity/Render/DefaultLanguageRenderer.php \Drupal\ds\Plugin\views\Entity\Render\DefaultLanguageRenderer::getLangcode()
  2. 8.3 src/Plugin/views/Entity/Render/DefaultLanguageRenderer.php \Drupal\ds\Plugin\views\Entity\Render\DefaultLanguageRenderer::getLangcode()

Returns the language code associated to the given row.

Parameters

\Drupal\views\ResultRow $row: The result row.

Return value

string A language code.

Overrides EntityTranslationRendererBase::getLangcode

1 method overrides DefaultLanguageRenderer::getLangcode()
TranslationLanguageRenderer::getLangcode in src/Plugin/views/Entity/Render/TranslationLanguageRenderer.php
Returns the language code associated to the given row.

File

src/Plugin/views/Entity/Render/DefaultLanguageRenderer.php, line 21

Class

DefaultLanguageRenderer
Renders entities in the current language.

Namespace

Drupal\ds\Plugin\views\Entity\Render

Code

public function getLangcode(ResultRow $row) {
  return $row->_entity
    ->getUntranslated()
    ->language()
    ->getId();
}