You are here

function state_flow_get_all_history in State Machine 7.3

Retrieve the states history for an entity.

Parameters

integer node id:

Return value

array of objects

1 call to state_flow_get_all_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 478
An implementation of node revision workflow for Drupal based on the State Machine system.

Code

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