You are here

function workflow_get_state in Workflow 5.2

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

Given the ID of a workflow state, return a keyed array representing the state.

Note: this will retrieve states that have been deleted (their status key will be set to 0).

Parameters

$sid: The ID of the workflow state.

Return value

A keyed array with all attributes of the state.

1 call to workflow_get_state()
workflow_state_add_form in ./workflow.module
Menu callback to create form to add a workflow state.

File

./workflow.module, line 1738

Code

function workflow_get_state($sid) {
  $state = array();
  $result = db_query('SELECT wid, state, weight, sysid, status FROM {workflow_states} WHERE sid = %d', $sid);
  while ($data = db_fetch_object($result)) {
    $state['wid'] = $data->wid;
    $state['state'] = $data->state;
    $state['weight'] = $data->weight;
    $state['sysid'] = $data->sysid;
    $state['status'] = $data->status;
  }
  return $state;
}