diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-12-15 03:39:42 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-12-15 03:39:42 +0000 |
commit | 71c4e3ec62427e562965561f5a7b13aa64737595 (patch) | |
tree | 312ab891d1692d08008ab3bb20a8bb22f44d1f06 /modules/system | |
parent | 0afbd86d32a94c3b11c6cbe4204e66d8cfa1da3a (diff) | |
download | brdo-71c4e3ec62427e562965561f5a7b13aa64737595.tar.gz brdo-71c4e3ec62427e562965561f5a7b13aa64737595.tar.bz2 |
#968458 by Dave Reid, sun, fago: Add Missing hook_entity_presave().
Diffstat (limited to 'modules/system')
-rw-r--r-- | modules/system/system.api.php | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 3d73c0647..aed02ae2c 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -281,6 +281,18 @@ function hook_entity_load($entities, $type) { } /** + * Act on an entity before it is about to be created or updated. + * + * @param $entity + * The entity object. + * @param $type + * The type of entity being saved (i.e. node, user, comment). + */ +function hook_entity_presave($entity, $type) { + $entity->changed = REQUEST_TIME; +} + +/** * Act on entities when inserted. * * @param $entity @@ -2545,7 +2557,7 @@ function hook_file_validate(&$file) { } /** - * Respond to a file being added. + * Act on a file being inserted or updated. * * This hook is called when a file has been added to the database. The hook * doesn't distinguish between files created as a result of a copy or those @@ -2556,6 +2568,23 @@ function hook_file_validate(&$file) { * * @see file_save() */ +function hook_file_presave($file) { + // Change the file timestamp to an hour prior. + $file->timestamp -= 3600; +} + +/** + * Respond to a file being added. + * + * This hook is called before a file has been added to the database. The hook + * doesn't distinguish between files created as a result of a copy or those + * created by an upload. + * + * @param $file + * The file that is about to be saved. + * + * @see file_save() + */ function hook_file_insert($file) { } |