You are here

public function StateFlow::get_event in State Machine 7

Same name and namespace in other branches
  1. 6 modules/state_flow/plugins/state_flow.inc \StateFlow::get_event()
  2. 7.2 modules/state_flow/plugins/state_flow.inc \StateFlow::get_event()

Return an event instance by key, lazy-loading the instance if necessary.

Parameters

$key: The string identifier of the event to be returned.

Return value

An instance of StateMachine_Event, or FALSE if the key specified does not represent a valid event.

Overrides StateMachine::get_event

1 call to StateFlow::get_event()
StateFlow::fire_event in modules/state_flow/plugins/state_flow.inc
Extending fire_event() from state_machine's base.inc to add uid and log arguments.

File

modules/state_flow/plugins/state_flow.inc, line 62

Class

StateFlow

Code

public function get_event($key) {
  if (!array_key_exists($key, $this->events)) {
    return FALSE;
  }
  if (is_array($this->events[$key])) {
    $options = $this->events[$key];
    $this->events[$key] = new StateFlow_Event($this, $options);
  }
  return $this->events[$key];
}