1 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

core/modules/entity/entity.api.php, line 234
Hooks provided by the Entity module.

Code

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