function hook_entity_storage_load
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/entity.api.php \hook_entity_storage_load()
- 8.9.x core/lib/Drupal/Core/Entity/entity.api.php \hook_entity_storage_load()
- 10 core/lib/Drupal/Core/Entity/entity.api.php \hook_entity_storage_load()
Act on content entities when loaded from the storage.
The results of this hook will be cached.
Parameters
\Drupal\Core\Entity\EntityInterface[] $entities: The entities keyed by entity ID.
string $entity_type: The type of entities being loaded (i.e. node, user, comment).
See also
Related topics
File
-
core/
lib/ Drupal/ Core/ Entity/ entity.api.php, line 1104
Code
function hook_entity_storage_load(array $entities, $entity_type) : void {
foreach ($entities as $entity) {
$entity->foo = my_module_add_something_uncached($entity);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.