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
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); } }
Please login to continue.