summaryrefslogtreecommitdiff
path: root/modules/system/system.api.php
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 /modules/system/system.api.php
parent92f5a844b25e7855691a9338f9466e8f5c9a07af (diff)
downloadbrdo-1c7bca0b6f824dc99101802286a348dcfc71cd01.tar.gz
brdo-1c7bca0b6f824dc99101802286a348dcfc71cd01.tar.bz2
#605442 by catch: Add a generic hook_entity_load().
Diffstat (limited to 'modules/system/system.api.php')
-rw-r--r--modules/system/system.api.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php
index d29a16035..f6b9be1ef 100644
--- a/modules/system/system.api.php
+++ b/modules/system/system.api.php
@@ -150,6 +150,23 @@ function hook_entity_info_alter(&$entity_info) {
}
/**
+ * Act on entities when loaded.
+ *
+ * This is a generic load hook called for all entity types loaded via the
+ * entity API.
+ *
+ * @param $entities
+ * The entities keyed by entity ID.
+ * @param $type
+ * The type of entities being loaded (i.e. node, user, comment).
+ */
+function hook_entity_load($entities, $type) {
+ foreach ($entities as $entity) {
+ $entity->foo = mymodule_add_something($entity, $entity_type);
+ }
+}
+
+/**
* Perform periodic actions.
*
* This hook will only be called if cron.php is run (e.g. by crontab).