You are here

function workflow_state_save in Workflow 6

Same name and namespace in other branches
  1. 5.2 workflow.module \workflow_state_save()
  2. 5 workflow.module \workflow_state_save()
  3. 6.2 workflow.module \workflow_state_save()

Add or update a workflow state to the database.

Parameters

$edit: An array containing values for the new or updated workflow state.

Return value

The ID of the new or updated workflow state.

2 calls to workflow_state_save()
workflow_admin_ui_state_add_form_submit in workflow_admin_ui/workflow_admin_ui.module
Submit handler for state addition form.
workflow_create in ./workflow.module
Create a workflow and its (creation) state.

File

./workflow.module, line 871
Support workflows made up of arbitrary states.

Code

function workflow_state_save($state) {
  if (!isset($state['sid'])) {
    drupal_write_record('workflow_states', $state);
  }
  else {
    drupal_write_record('workflow_states', $state, 'sid');
  }
  return $state['sid'];
}