summaryrefslogtreecommitdiff
path: root/includes/entity.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/entity.inc')
-rw-r--r--includes/entity.inc10
1 files changed, 8 insertions, 2 deletions
diff --git a/includes/entity.inc b/includes/entity.inc
index e50cf6fb3..ba9175d9a 100644
--- a/includes/entity.inc
+++ b/includes/entity.inc
@@ -223,8 +223,9 @@ class DrupalDefaultEntityController implements DrupalEntityControllerInterface {
/**
* Attach data to entities upon loading.
*
- * This will attach fields, if the entity is fieldable. It also calls
- * hook_TYPE_load() on the loaded entities. For example
+ * This will attach fields, if the entity is fieldable. It calls
+ * hook_entity_load() for modules which need to add data to all entities.
+ * It also calls hook_TYPE_load() on the loaded entities. For example
* hook_node_load() or hook_user_load(). If your hook_TYPE_load()
* expects special parameters apart from the queried entities, you can set
* $this->hookLoadArguments prior to calling the method.
@@ -241,6 +242,11 @@ class DrupalDefaultEntityController implements DrupalEntityControllerInterface {
}
}
+ // Call hook_entity_load().
+ foreach (module_implements('entity_load') as $module) {
+ $function = $module . '_entity_load';
+ $function($queried_entities, $this->entityType);
+ }
// Call hook_TYPE_load(). The first argument for hook_TYPE_load() are
// always the queried entities, followed by additional arguments set in
// $this->hookLoadArguments.