You are here

function state_flow_node_presave in State Machine 6

Same name and namespace in other branches
  1. 7 modules/state_flow/state_flow.module \state_flow_node_presave()
  2. 7.2 modules/state_flow/state_flow.module \state_flow_node_presave()

Implementation of hook_node_presave()

Parameters

object $node:

File

modules/state_flow/state_flow.module, line 223
A base implementation of the state machine class and its relationship to revisions

Code

function state_flow_node_presave(&$node) {
  $state_flow = state_flow_load_state_machine($node);
  $state = $state_flow
    ->get_current_state();
  if ($state == 'published') {

    //force revision
    $node->revision = TRUE;
  }
}