function hook_ENTITY_TYPE_storage_load
Same name in other branches
- 8.9.x core/lib/Drupal/Core/Entity/entity.api.php \hook_ENTITY_TYPE_storage_load()
- 10 core/lib/Drupal/Core/Entity/entity.api.php \hook_ENTITY_TYPE_storage_load()
- 11.x core/lib/Drupal/Core/Entity/entity.api.php \hook_ENTITY_TYPE_storage_load()
Act on content entities of a given type when loaded from the storage.
The results of this hook will be cached if the entity type supports it.
Parameters
\Drupal\Core\Entity\EntityInterface[] $entities: The entities keyed by entity ID.
See also
Related topics
File
-
core/
lib/ Drupal/ Core/ Entity/ entity.api.php, line 1124
Code
function hook_ENTITY_TYPE_storage_load(array $entities) {
foreach ($entities as $entity) {
$entity->foo = mymodule_add_something_uncached($entity);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.