class EntityTranslationRenderer in Search API 8
Renders entity translations in their row language.
Hierarchy
- class \Drupal\views\Entity\Render\RendererBase implements CacheableDependencyInterface
- class \Drupal\views\Entity\Render\EntityTranslationRendererBase
- class \Drupal\views\Entity\Render\TranslationLanguageRenderer
- class \Drupal\search_api\Plugin\views\EntityTranslationRenderer
- class \Drupal\views\Entity\Render\TranslationLanguageRenderer
- class \Drupal\views\Entity\Render\EntityTranslationRendererBase
Expanded class hierarchy of EntityTranslationRenderer
File
- src/
Plugin/ views/ EntityTranslationRenderer.php, line 12
Namespace
Drupal\search_api\Plugin\viewsView source
class EntityTranslationRenderer extends TranslationLanguageRenderer {
/**
* {@inheritdoc}
*/
public function getLangcode(ViewsResultRow $row) {
// If our normal query plugin is used, the fallback shouldn't really ever be
// needed, but if it is we fall back to the current request's content
// language.
return $row->search_api_language ?? $this->languageManager
->getCurrentLanguage(LanguageInterface::TYPE_CONTENT)
->getId();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityTranslationRenderer:: |
public | function |
Returns the language code associated with the given row. Overrides TranslationLanguageRenderer:: |
|
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 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 | Constructs a renderer object. | 2 |
TranslationLanguageRenderer:: |
protected | property | Stores the field alias of the langcode column. | |
TranslationLanguageRenderer:: |
public | function |
The cache contexts associated with this object. Overrides RendererBase:: |
|
TranslationLanguageRenderer:: |
protected | function | Returns the name of the table holding the "langcode" field. | |
TranslationLanguageRenderer:: |
public | function |
Runs before each entity is rendered. Overrides EntityTranslationRendererBase:: |
|
TranslationLanguageRenderer:: |
public | function |
Alters the query if needed. Overrides EntityTranslationRendererBase:: |
|
TranslationLanguageRenderer:: |
public | function |
Renders entity data. Overrides EntityTranslationRendererBase:: |