public function StateMachine::get_available_events in State Machine 7
Same name and namespace in other branches
- 6 inc/base.inc \StateMachine::get_available_events()
- 7.3 inc/base.inc \StateMachine::get_available_events()
- 7.2 inc/base.inc \StateMachine::get_available_events()
Returns an array of events that are valid for the current state.
File
Class
- StateMachine
- @file base.inc
Code
public function get_available_events() {
$events = array();
foreach (array_keys($this->events) as $key) {
if ($this
->get_event($key)
->can_transition_from($this
->get_current_state())) {
$events[] = $key;
}
}
return $events;
}