ConfigurableLanguageRenderer.php in Views Parity Row 8
File
src/Plugin/views/Entity/Render/ConfigurableLanguageRenderer.php
View source
<?php
declare (strict_types=1);
namespace Drupal\views_parity_row\Plugin\views\Entity\Render;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\views\Plugin\views\query\QueryPluginBase;
use Drupal\views\ResultRow;
use Drupal\views\ViewExecutable;
class ConfigurableLanguageRenderer extends RendererBase {
protected $langcode;
public function __construct(ViewExecutable $view, LanguageManagerInterface $language_manager, EntityTypeInterface $entity_type, $langcode) {
parent::__construct($view, $language_manager, $entity_type);
$this->langcode = $langcode;
}
public function getLangcode(ResultRow $row) {
return $this->langcode;
}
public function query(QueryPluginBase $query, $relationship = NULL) {
}
public function render(ResultRow $row) {
$entity_id = $row->_entity
->id();
return $this->build[$entity_id];
}
}