You are here

function revision_scheduler_entity_insert in Revision scheduler 7

Implements hook_entity_insert().

File

./revision_scheduler.module, line 807

Code

function revision_scheduler_entity_insert($entity, $entity_type) {
  if (!empty($entity->revision_scheduler['operation'])) {
    $operation = (object) $entity->revision_scheduler;
    list($operation->entity_id, $operation->revision_id) = entity_extract_ids($entity_type, $entity);
    revision_scheduler_operation_save($operation);
    $entity->revision_scheduler = (array) $operation;
  }
}