Skip navigation
Help

hook_entity_presave

7 system.api.php 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

1 function implements hook_entity_presave()

9 invocations of hook_entity_presave()

File

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

Code

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