function workflow_get_workflow_for_type in Workflow 5.2
Same name and namespace in other branches
- 5 workflow.module \workflow_get_workflow_for_type()
- 6.2 workflow.module \workflow_get_workflow_for_type()
- 6 workflow.module \workflow_get_workflow_for_type()
Get ID of a workflow for a node type.
Return value
int The ID of the workflow or FALSE if none.
8 calls to workflow_get_workflow_for_type()
- workflow_field_choices in ./
workflow.module - Get the states one can move to for a given node.
- workflow_form_alter in ./
workflow.module - Modify the node form to add the workflow field.
- workflow_menu in ./
workflow.module - Implementation of hook_menu().
- workflow_nodeapi in ./
workflow.module - Implementation of hook_nodeapi().
- workflow_node_current_state in ./
workflow.module - Get the current state of a given node.
File
- ./
workflow.module, line 1615
Code
function workflow_get_workflow_for_type($type) {
static $cache;
if (!isset($cache[$type])) {
$wid = db_result(db_query("SELECT wid FROM {workflow_type_map} WHERE type = '%s'", $type));
$cache[$type] = $wid;
}
else {
$wid = $cache[$type];
}
return $wid > 0 ? $wid : FALSE;
}