You are here

public function StateFlowEntity::delete_state_flow_revision in State Machine 7.3

File

modules/state_flow_entity/plugins/state_flow_entity.inc, line 896
State Flow implementation of the State Machine class.

Class

StateFlowEntity
@file State Flow implementation of the State Machine class.

Code

public function delete_state_flow_revision($revision_id, $entity_type) {

  // @todo Deleting field data needs testing.
  field_attach_delete_revision('state_flow_history_entity', $this
    ->get_history_entity());

  // Delete entity records.
  db_delete('state_flow_history')
    ->condition('revision_id', $revision_id)
    ->condition('entity_type', $entity_type)
    ->execute();
  db_delete('state_flow_states')
    ->condition('revision_id', $revision_id)
    ->condition('entity_type', $entity_type)
    ->execute();
}