class ConfigurableLanguageRenderer in Drupal 9
Same name and namespace in other branches
- 8 core/modules/views/src/Entity/Render/ConfigurableLanguageRenderer.php \Drupal\views\Entity\Render\ConfigurableLanguageRenderer
Renders entities in a configured language.
Hierarchy
- class \Drupal\views\Entity\Render\RendererBase implements CacheableDependencyInterface
- class \Drupal\views\Entity\Render\EntityTranslationRendererBase
- class \Drupal\views\Entity\Render\ConfigurableLanguageRenderer
- class \Drupal\views\Entity\Render\EntityTranslationRendererBase
Expanded class hierarchy of ConfigurableLanguageRenderer
1 string reference to 'ConfigurableLanguageRenderer'
- EntityTranslationRenderTrait::getEntityTranslationRenderer in core/
modules/ views/ src/ Entity/ Render/ EntityTranslationRenderTrait.php - Returns the current renderer.
File
- core/
modules/ views/ src/ Entity/ Render/ ConfigurableLanguageRenderer.php, line 13
Namespace
Drupal\views\Entity\RenderView source
class ConfigurableLanguageRenderer extends EntityTranslationRendererBase {
/**
* A specific language code for rendering if available.
*
* @var string|null
*/
protected $langcode;
/**
* Constructs a renderer object.
*
* @param \Drupal\views\ViewExecutable $view
* The entity row being rendered.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
* @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
* The entity type.
* @param string|null $langcode
* A specific language code to set, if available.
*/
public function __construct(ViewExecutable $view, LanguageManagerInterface $language_manager, EntityTypeInterface $entity_type, $langcode) {
parent::__construct($view, $language_manager, $entity_type);
$this->langcode = $langcode;
}
/**
* {@inheritdoc}
*/
public function getLangcode(ResultRow $row) {
return $this->langcode;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigurableLanguageRenderer:: |
protected | property | A specific language code for rendering if available. | |
ConfigurableLanguageRenderer:: |
public | function |
Returns the language code associated with the given row. Overrides EntityTranslationRendererBase:: |
|
ConfigurableLanguageRenderer:: |
public | function |
Constructs a renderer object. Overrides RendererBase:: |
|
EntityTranslationRendererBase:: |
public | function |
Runs before each entity is rendered. Overrides RendererBase:: |
1 |
EntityTranslationRendererBase:: |
public | function |
Alters the query if needed. Overrides RendererBase:: |
1 |
EntityTranslationRendererBase:: |
public | function |
Renders entity data. Overrides RendererBase:: |
1 |
RendererBase:: |
protected | property | Contains an array of render arrays, one for each rendered entity. | |
RendererBase:: |
protected | property | The type of the entity being rendered. | |
RendererBase:: |
protected | property | The language manager. | |
RendererBase:: |
public | property | The view executable wrapping the view storage entity. | |
RendererBase:: |
public | function |
The cache contexts associated with this object. Overrides CacheableDependencyInterface:: |
2 |
RendererBase:: |
public | function |
The maximum age for which this object may be cached. Overrides CacheableDependencyInterface:: |
|
RendererBase:: |
public | function |
The cache tags associated with this object. Overrides CacheableDependencyInterface:: |