Drupal 8  8.0.2
RendererBase Class Reference
Inheritance diagram for RendererBase:

Public Member Functions

 __construct (ViewExecutable $view, LanguageManagerInterface $language_manager, EntityTypeInterface $entity_type)
 
 getCacheMaxAge ()
 
 getCacheContexts ()
 
 getCacheTags ()
 
 query (QueryPluginBase $query, $relationship=NULL)
 
 preRender (array $result)
 
 render (ResultRow $row)
 

Data Fields

 $view
 

Protected Attributes

 $languageManager
 
 $entityType
 
 $build
 

Detailed Description

Defines a base class for entity renderers.

Constructor & Destructor Documentation

__construct ( ViewExecutable  $view,
LanguageManagerInterface  $language_manager,
EntityTypeInterface  $entity_type 
)

Constructs a renderer object.

Parameters
\Drupal\views\ViewExecutable$viewThe entity row being rendered.
\Drupal\Core\Language\LanguageManagerInterface$language_managerThe language manager.
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe entity type.

References Drupal\languageManager().

Here is the call graph for this function:

Member Function Documentation

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 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.

Returns
string[] An array of cache context tokens, used to generate a cache ID.
See Also
::convertTokensToKeys()
}

Implements CacheableDependencyInterface.

getCacheMaxAge ( )

{The maximum age for which this object may be cached.

Returns
int The maximum time in seconds that this object may be cached.
}

Implements CacheableDependencyInterface.

References Cache\PERMANENT.

getCacheTags ( )

{The cache tags associated with this object.When this object is modified, these cache tags will be invalidated.

Returns
string[] A set of cache tags.
}

Implements CacheableDependencyInterface.

preRender ( array  $result)

Runs before each entity is rendered.

Parameters
$resultThe full array of results from the query.
query ( QueryPluginBase  $query,
  $relationship = NULL 
)
abstract

Alters the query if needed.

Parameters
\Drupal\views\Plugin\views\query\QueryPluginBase$queryThe query to alter.
string$relationship(optional) The relationship, used by a field.
render ( ResultRow  $row)
abstract

Renders entity data.

Parameters
\Drupal\views\ResultRow$rowA single row of the query result.
Returns
array A renderable array for the entity data contained in the result row.

The documentation for this class was generated from the following file: