You are here

function workflow_update_workflow_states in Workflow 7.2

Same name and namespace in other branches
  1. 7 workflow.deprecated.inc \workflow_update_workflow_states()

Save (update/insert) a Workflow State into table {workflow_states}.

@deprecated: workflow_update_workflow_states() --> WorkflowState->save()

File

./workflow.deprecated.inc, line 367
Contains contains per-class functions, that are deprecated.

Code

function workflow_update_workflow_states(&$data) {
  $data = (object) $data;
  if (!isset($data->sysid)) {
    $data->sysid = 0;
  }
  if (!isset($data->status)) {
    $data->status = 1;
  }
  if (isset($data->sid) && workflow_state_load_single($data->sid)) {
    drupal_write_record('workflow_states', $data, 'sid');
  }
  else {
    drupal_write_record('workflow_states', $data);
  }
}