hook_entity_presave

7 system.api.php hook_entity_presave($entity, $type)
8 entity.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()

6 invocations of hook_entity_presave()

File

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;
}
Login or register to post comments