function hook_entity_presave

hook_entity_presave($entity, $type)

Act on an entity before it is about to be created or updated.

Parameters

$entity: The entity object.

$type: The type of entity being saved (i.e. node, user, comment).

Related topics

File

modules/system/system.api.php, line 316
Hooks provided by Drupal core and the System module.

Code

function hook_entity_presave($entity, $type) {
  $entity->changed = REQUEST_TIME;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_entity_presave/7.x