You are here

function revision_scheduler_entity_update in Revision scheduler 7

Implements hook_entity_update().

File

./revision_scheduler.module, line 819

Code

function revision_scheduler_entity_update($entity, $entity_type) {
  if (!empty($entity->revision_scheduler['operation'])) {
    $operation = (object) $entity->revision_scheduler;

    // Update the revision ID in case a new revision was created.
    list(, $operation->revision_id) = entity_extract_ids($entity_type, $entity);
    revision_scheduler_operation_save($operation);
    $entity->revision_scheduler = (array) $operation;
  }
  drupal_static_reset('revision_scheduler_entity_revision_load_multiple');
}