hook_ENTITY_TYPE_build_defaults_alter(array &$build, \Drupal\Core\Entity\EntityInterface $entity, $view_mode)
Alter entity renderable values before cache checking in drupal_render().
Invoked for a specific entity type.
The values in the #cache key of the renderable array are used to determine if a cache entry exists for the entity's rendered output. Ideally only values that pertain to caching should be altered in this hook.
array &$build: A renderable array containing the entity's caching and view mode values.
\Drupal\Core\Entity\EntityInterface $entity: The entity that is being viewed.
string $view_mode: The view_mode that is to be used to display the entity.
\Drupal\Core\Entity\EntityViewBuilder
hook_entity_build_defaults_alter()
function hook_ENTITY_TYPE_build_defaults_alter(array &$build, \Drupal\Core\Entity\EntityInterface $entity, $view_mode) { }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!entity.api.php/function/hook_ENTITY_TYPE_build_defaults_alter/8.1.x