You are here

function state_flow_get_history in State Machine 7

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

Retrieve the states history for a node.

1 call to state_flow_get_history()
state_flow_events in modules/state_flow/state_flow.pages.inc
Page callback for a node's Workflow page.

File

modules/state_flow/state_flow.module, line 301
An implementation of node revision workflow for Drupal based on the State Machine system.

Code

function state_flow_get_history($nid) {
  $history = db_query('
    SELECT nrsh.*, u.uid, u.name AS user_name
    FROM {node_revision_states_history} nrsh
    LEFT JOIN {users} u ON u.uid = nrsh.uid
    WHERE nrsh.nid = :nid
    ORDER BY nrsh.timestamp DESC', array(
    ':nid' => $nid,
  ))
    ->fetchAll();
  return $history;
}