1.20.x 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
File
- modules/
entity/ entity.api.php, line 230 - Hooks provided by the Entity module.
Code
function hook_entity_presave($entity, $type) {
$entity->changed = REQUEST_TIME;
}