You are here

protected function StateMachine::set_current_state in State Machine 6

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

Set the current state to the state identified by the specified key.

2 calls to StateMachine::set_current_state()
StateMachine::fire_event in inc/base.inc
Trigger an event to process a transition. Callbacks and guard conditions will be processed in the following order:
StateMachine::__construct in inc/base.inc

File

inc/base.inc, line 76

Class

StateMachine

Code

protected function set_current_state($key) {
  if (array_key_exists($key, $this->states)) {
    $this->current = $key;
    return TRUE;
  }
  return FALSE;
}