You are here

public function StateMachine::get_current_state in State Machine 7.2

Same name and namespace in other branches
  1. 6 inc/base.inc \StateMachine::get_current_state()
  2. 7.3 inc/base.inc \StateMachine::get_current_state()
  3. 7 inc/base.inc \StateMachine::get_current_state()

Returns the current state.

4 calls to StateMachine::get_current_state()
StateFlow::get_label_for_current_state in modules/state_flow/plugins/state_flow.inc
Get the label for the current state
StateFlow::persist in modules/state_flow/plugins/state_flow.inc
Persist the current state to the object storage.
StateFlow::write_history in modules/state_flow/plugins/state_flow.inc
StateMachine::get_available_events in inc/base.inc
Returns an array of events that are valid for the current state.

File

inc/base.inc, line 92
base.inc

Class

StateMachine
@file base.inc

Code

public function get_current_state() {
  if (!$this->current) {
    $this->current = key($this->states);
  }
  return $this->current;
}