You are here

function workflow_get_workflow_type_map_by_type in Workflow 7

Same name and namespace in other branches
  1. 7.2 workflow.node.type_map.inc \workflow_get_workflow_type_map_by_type()

Get workflow_type_map for a type. On no record, FALSE is returned. Currently this is a unique result but requests have been made to allow a node to have multiple workflows. This is trickier than it sounds as a lot of our processing code will have to be tweaked to account for multiple results. ALERT: If a node type is *not* mapped to a workflow it will be listed as wid 0. Hence, we filter out the non-mapped results.

@todo: remove in a future (D8) version. This function is deprecated in favor of

See also

workflow_get_workflows_by_type()

2 calls to workflow_get_workflow_type_map_by_type()
workflow_field_choices in ./workflow.node.inc
Get the states current user can move to for a given node.
workflow_get_workflows_by_type in ./workflow.module
Get a specific workflow, given a Node type. Only one workflow is possible per node type.

File

./workflow.node.type_map.inc, line 30
Node specific functions, remnants of nodeapi.

Code

function workflow_get_workflow_type_map_by_type($type) {
  static $map = array();
  if (!isset($map[$type])) {
    $results = db_query('SELECT type, wid FROM {workflow_type_map} WHERE type = :type AND wid <> 0', array(
      ':type' => $type,
    ));
    $map[$type] = $results
      ->fetchObject();
  }
  return $map[$type];
}