public function StateMachine_Event::execute in State Machine 6
Same name and namespace in other branches
- 7.3 inc/base.inc \StateMachine_Event::execute()
- 7 inc/base.inc \StateMachine_Event::execute()
- 7.2 inc/base.inc \StateMachine_Event::execute()
Execute the event. Tests to make sure the current state is a valid origin state, checks the guard condition,
File
- inc/
base.inc, line 267
Class
Code
public function execute() {
if (!in_array($this->machine
->get_current_state(), $this->options['origin'])) {
return FALSE;
}
if (!$this
->validate()) {
return FALSE;
}
if (!empty($this->options['before_transition'])) {
call_user_func($this->options['before_transition']);
}
return $this->options['target'];
}