You are here

public function StateMachine::get_current_state in State Machine 7

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.2 inc/base.inc \StateMachine::get_current_state()

Returns the current state.

3 calls to StateMachine::get_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 90
base.inc

Class

StateMachine
@file base.inc

Code

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