How to use hook_entity_presave?
Function hook_entity_presave acts on an entity before it is about to be created or updated


Code:

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


source :  Drupal API