public function StateMachine::get_available_events in State Machine 6
Same name and namespace in other branches
- 7.3 inc/base.inc \StateMachine::get_available_events()
- 7 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
- inc/
base.inc, line 195
Class
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;
}