You are here

function workflow_get_state in Workflow 5

Same name and namespace in other branches
  1. 5.2 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, return an array with all its attributes.

Parameters

$sid: The ID of the workflow state.

Return value

An 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 1573

Code

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