You are here

function workflow_insert_workflow_type_map in Workflow 7.2

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

Given information, inserts a new workflow_type_map. Returns data by ref. (like node_save).

@todo: why is this here instead of the admin_ui?

2 calls to workflow_insert_workflow_type_map()
Workflow::rebuildInternals in includes/Entity/Workflow.php
Rebuild internals that get saved separately.
workflow_admin_ui_type_map_form_submit in workflow_admin_ui/workflow_admin_ui.page.type_map.inc
Submit handler for workflow type mapping form.

File

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

Code

function workflow_insert_workflow_type_map($node_type, $wid) {
  $type_map = (object) array(
    'type' => $node_type,
    'wid' => $wid,
  );

  // Be sure we have a clean insert. There should never be more than one map for a type.
  workflow_delete_workflow_type_map_by_type($type_map->type);
  if ($type_map->wid) {
    drupal_write_record('workflow_type_map', $type_map);
  }
}