workflow_get_workflow_node_history_by_nid

  1. workflow
    1. 7
Versions
7 workflow_get_workflow_node_history_by_nid($nid, $limit = NULL)

Get all recored history for a node id. Since this may return a lot of data, a limit is included to allow for only one result.

Code

./workflow.module, line 1322

<?php
function workflow_get_workflow_node_history_by_nid($nid, $limit = NULL) {
  if (empty($limit)) {
    $limit = variable_get('workflow_states_per_page', 20);
  }
  $results = db_query('SELECT * FROM {workflow_node_history} h ' .
    'LEFT JOIN {users} u ON h.uid = u.uid ' .
    'WHERE nid = :nid ORDER BY h.hid DESC', array(':nid' => $nid));
  if ($limit == 1) {
    return $results->fetchObject();
  }
  return $results->fetchAll();
}
?>