| 7 system.api.php | hook_entity_load($entities, $type) |
| 8 entity.api.php | hook_entity_load($entities, $type) |
Act on entities when loaded.
This is a generic load hook called for all entity types loaded via the entity API.
Parameters
$entities: The entities keyed by entity ID.
$type: The type of entities being loaded (i.e. node, user, comment).
Related topics
2 functions implement hook_entity_load()
1 invocation of hook_entity_load()
File
- modules/
system/ system.api.php, line 281 - Hooks provided by Drupal core and the System module.
Code
function hook_entity_load($entities, $type) {
foreach ($entities as $entity) {
$entity->foo = mymodule_add_something($entity, $type);
}
}
Login or register to post comments