DefaultLanguageRenderer.php in Display Suite 8.3
Same filename and directory in other branches
Namespace
Drupal\ds\Plugin\views\Entity\RenderFile
src/Plugin/views/Entity/Render/DefaultLanguageRenderer.phpView source
<?php
namespace Drupal\ds\Plugin\views\Entity\Render;
use Drupal\views\ResultRow;
/**
* Renders entities in the current language.
*/
class DefaultLanguageRenderer extends RendererBase {
/**
* Returns the language code associated to the given row.
*
* @param \Drupal\views\ResultRow $row
* The result row.
*
* @return string
* A language code.
*/
public function getLangcode(ResultRow $row) {
return $row->_entity
->getUntranslated()
->language()
->getId();
}
}
Classes
Name | Description |
---|---|
DefaultLanguageRenderer | Renders entities in the current language. |