RendererBase
abstract class RendererBase implements CacheableDependencyInterface (View source)
Defines a base class for entity renderers.
Properties
| ViewExecutable | $view | The view executable wrapping the view storage entity. |
|
| protected LanguageManagerInterface | $languageManager | The language manager. |
|
| protected EntityTypeInterface | $entityType | The type of the entity being rendered. |
|
| protected array | $build | Contains an array of render arrays, one for each rendered entity. |
Methods
Constructs a renderer object.
The maximum age for which this object may be cached.
The cache contexts associated with this object.
The cache tags associated with this object.
Runs before each entity is rendered.
Details
__construct(ViewExecutable $view, LanguageManagerInterface $language_manager, EntityTypeInterface $entity_type)
Constructs a renderer object.
int
getCacheMaxAge()
The maximum age for which this object may be cached.
string[]
getCacheContexts()
The cache contexts associated with this object.
These identify a specific variation/representation of the object.
Cache contexts are tokens: placeholders that are converted to cache keys by the @cache_contexts_manager service. The replacement value depends on the request context (the current URL, language, and so on). They're converted before storing an object in cache.
string[]
getCacheTags()
The cache tags associated with this object.
When this object is modified, these cache tags will be invalidated.
abstract
query(QueryPluginBase $query, string $relationship = NULL)
Alters the query if needed.
preRender(array $result)
Runs before each entity is rendered.
abstract array
render(ResultRow $row)
Renders entity data.