function ExecutionState::getVariable
Overrides ExecutionStateInterface::getVariable
1 call to ExecutionState::getVariable()
- ExecutionState::fetchDataByPropertyPath in src/
Context/ ExecutionState.php - Returns a value as specified in the selector.
File
-
src/
Context/ ExecutionState.php, line 100
Class
- ExecutionState
- The rules execution state.
Namespace
Drupal\rules\ContextCode
public function getVariable($name) {
if (!$this->hasVariable($name)) {
// @todo This crashes site in certain circumstances - for example if
// you're reacting on a "Drupal is initializing" event ... Need to handle
// a problem here gracefully - maybe disable the rule that caused the
// problem?
throw new EvaluationException("Unable to get variable '{$name}'; it is not defined.");
}
return $this->variables[$name];
}