summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-16 03:47:14 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-16 03:47:14 +0000
commit1c7bca0b6f824dc99101802286a348dcfc71cd01 (patch)
tree04b48059bb095b0a25d9b9924e8176faedfbb9db /includes
parent92f5a844b25e7855691a9338f9466e8f5c9a07af (diff)
downloadbrdo-1c7bca0b6f824dc99101802286a348dcfc71cd01.tar.gz
brdo-1c7bca0b6f824dc99101802286a348dcfc71cd01.tar.bz2
#605442 by catch: Add a generic hook_entity_load().
Diffstat (limited to 'includes')
-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.