function workflow_get_workflow_states_by_type in Workflow 7
Same name and namespace in other branches
- 7.2 workflow.deprecated.inc \workflow_get_workflow_states_by_type()
Get all states in the system by content type.
File
- ./
workflow.deprecated.inc, line 102 - 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_get_workflow_states_by_type($type) {
$query = "SELECT ws.sid, ws.wid, ws.state, ws.weight, ws.sysid " . "FROM {workflow_type_map} wtm " . "INNER JOIN {workflow_states} ws ON ws.wid = wtm.wid " . "WHERE wtm.type = :type AND ws.status = 1 " . "ORDER BY ws.weight, ws.sid ";
$query_array = array(
':type' => $type,
);
$results = db_query($query, $query_array);
return $results
->fetchAll();
}