You are here

function workflow_get_recent_node_history in Workflow 7

Same name and namespace in other branches
  1. 7.2 workflow.deprecated.inc \workflow_get_recent_node_history()

Get most recent history for a node.

3 calls to workflow_get_recent_node_history()
workflow_node_load in ./workflow.node.inc
Implements hook_node_load(). @TODO: Consider replacing with hook_entity_load().
workflow_node_previous_state in ./workflow.module
workflow_tokens in ./workflow.tokens.inc
Implements hook_tokens().

File

./workflow.module, line 865
Support workflows made up of arbitrary states.

Code

function workflow_get_recent_node_history($nid) {
  $results = db_query_range('SELECT h.hid, h.nid, h.old_sid, h.sid, h.uid, h.stamp, h.comment, ' . 's.state AS state_name ' . 'FROM {workflow_node_history} h ' . 'INNER JOIN {workflow_states} s ON s.sid = h.sid ' . 'WHERE h.nid = :nid ORDER BY h.stamp DESC', 0, 1, array(
    ':nid' => $nid,
  ));
  return $results
    ->fetchObject();
}