You are here

public function ExecutionState::removeVariable in Rules 8.3

Removes a variable from the state if it is set.

Parameters

string $name: The name of the variable to remove.

Return value

$this

Overrides ExecutionStateInterface::removeVariable

File

src/Context/ExecutionState.php, line 140

Class

ExecutionState
The rules execution state.

Namespace

Drupal\rules\Context

Code

public function removeVariable($name) {
  if (array_key_exists($name, $this->variables)) {
    unset($this->variables[$name]);
  }
  return $this;
}