abstract class DefaultLanguageRenderer in Views Parity Row 8
Renders entities in the current language.
Hierarchy
- class \Drupal\views\Entity\Render\RendererBase implements CacheableDependencyInterface
- class \Drupal\views_parity_row\Plugin\views\Entity\Render\RendererBase
- class \Drupal\views_parity_row\Plugin\views\Entity\Render\DefaultLanguageRenderer
- class \Drupal\views_parity_row\Plugin\views\Entity\Render\RendererBase
Expanded class hierarchy of DefaultLanguageRenderer
1 string reference to 'DefaultLanguageRenderer'
- EntityRow::getEntityTranslationRenderer in src/
Plugin/ views/ row/ EntityRow.php - Returns the current renderer.
File
- src/
Plugin/ views/ Entity/ Render/ DefaultLanguageRenderer.php, line 12
Namespace
Drupal\views_parity_row\Plugin\views\Entity\RenderView source
abstract 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()->id;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DefaultLanguageRenderer:: |
public | function | Returns the language code associated to the given row. | |
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:: |
|
RendererBase:: |
public | function |
Runs before each entity is rendered. Overrides RendererBase:: |
|
RendererBase:: |
abstract public | function | Alters the query if needed. | 2 |
RendererBase:: |
abstract public | function | Renders entity data. | 2 |
RendererBase:: |
public | function | Constructs a renderer object. | 2 |