You are here

protected function StateMachine_Event::validate in State Machine 6

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

Validate the transition by processing the guard condition.

2 calls to StateMachine_Event::validate()
StateFlow_Event::validate in modules/state_flow/plugins/state_flow.inc
Validate the transition by processing the guard condition.
StateMachine_Event::execute in inc/base.inc
Execute the event. Tests to make sure the current state is a valid origin state, checks the guard condition,
1 method overrides StateMachine_Event::validate()
StateFlow_Event::validate in modules/state_flow/plugins/state_flow.inc
Validate the transition by processing the guard condition.

File

inc/base.inc, line 253

Class

StateMachine_Event

Code

protected function validate() {

  // Execute guard condition if it exists.
  if (!empty($this->options['guard'])) {
    if (call_user_func($this->options['guard'], $this) === FALSE) {
      return FALSE;
    }
  }
  return TRUE;
}