hook_ENTITY_TYPE_load

hook_ENTITY_TYPE_load($entities)

Act on entities of a specific type when loaded.

Parameters

array $entities: The entities keyed by entity ID.

See also

hook_entity_load()

Related topics

Entity CRUD, editing, and view hooks
Hooks used in various entity operations.
Hooks
Define functions that alter the behavior of Drupal core.

File

core/lib/Drupal/Core/Entity/entity.api.php, line 852
Hooks and documentation related to entities.

Code

function hook_ENTITY_TYPE_load($entities) {
  foreach ($entities as $entity) {
    $entity->foo = mymodule_add_something($entity);
  }
}
doc_Drupal
2016-10-29 09:18:04
Comments
Leave a Comment

Please login to continue.