You are here

function workflow_update_workflow_states in Workflow 7

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

Save (update/insert) a Workflow State into table {workflow_states}. @deprecated: workflow_update_workflow_states() --> WorkflowState->save()

3 calls to workflow_update_workflow_states()
Workflow::save in includes/Entity/Workflow.php
Given information, update or insert a new workflow.
workflow_update_workflows in ./workflow.module
Given information, update or insert a new workflow. Returns data by ref. (like node_save).
workflow_update_workflows_full_object in ./workflow.features.inc
For use by CRUD only, save everything from the CRUD formed object.

File

./workflow.deprecated.inc, line 215
Contains contains per-class functions, that are deprecated. Usage: The new code can be tested, by removing this file-include from workflow.module.

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) && WorkflowState::load($data->sid)) {
    drupal_write_record('workflow_states', $data, 'sid');
  }
  else {
    drupal_write_record('workflow_states', $data);
  }
}