You are here

function workflow_get_workflow_transitions_by_wid in Workflow 7

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

Given a wid get the transitions.

1 call to workflow_get_workflow_transitions_by_wid()
workflow_update_workflows_full_object in ./workflow.features.inc
For use by CRUD only, save everything from the CRUD formed object.

File

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

Code

function workflow_get_workflow_transitions_by_wid($wid) {
  static $transitions;
  if (!isset($transitions[$wid])) {
    $query = 'SELECT t.tid, t.sid, t.target_sid, t.roles, s1.wid ' . 'FROM {workflow_transitions} t ' . 'INNER JOIN {workflow_states} s1 ON t.sid=s1.sid ' . 'INNER JOIN {workflow_states} s2 ON t.target_sid=s2.sid ' . 'WHERE s1.wid = :wid AND s2.wid = :wid';
    $transitions[$wid] = db_query('SELECT t.*, s1.wid FROM {workflow_transitions} AS t INNER JOIN {workflow_states} AS s1 ON t.sid=s1.sid INNER JOIN {workflow_states} AS s2 ON t.target_sid=s2.sid WHERE s1.wid = :wid AND s2.wid = :wid', array(
      ':wid' => $wid,
    ))
      ->fetchAll();
  }
  return $transitions[$wid];
}