You are here

public function StateFlow::latest_state in State Machine 6

Same name and namespace in other branches
  1. 7 modules/state_flow/plugins/state_flow.inc \StateFlow::latest_state()
  2. 7.2 modules/state_flow/plugins/state_flow.inc \StateFlow::latest_state()
1 call to StateFlow::latest_state()
StateFlow::load in modules/state_flow/plugins/state_flow.inc
Load the current state from the given state storage

File

modules/state_flow/plugins/state_flow.inc, line 102

Class

StateFlow

Code

public function latest_state($nid) {
  $query = "SELECT state\n              FROM {node_revision_states}\n              WHERE nid = %d AND status = 1 AND vid = %d\n              ORDER BY timestamp\n              DESC\n              LIMIT 1";
  return db_result(db_query($query, $nid, $this
    ->get_latest_revision($nid)));
}