You are here

public function ExecutionState::setVariableData in Rules 8.3

Sets a state variable with some typed data object.

Parameters

string $name: The variable name.

\Drupal\Core\TypedData\TypedDataInterface $data: The variable wrapped as typed data.

Return value

$this

Overrides ExecutionStateInterface::setVariableData

2 calls to ExecutionState::setVariableData()
ExecutionState::hasVariable in src/Context/ExecutionState.php
Checks if a variable exists by name in the execution state.
ExecutionState::setVariable in src/Context/ExecutionState.php
Sets a state variable based on its definition and value.

File

src/Context/ExecutionState.php, line 92

Class

ExecutionState
The rules execution state.

Namespace

Drupal\rules\Context

Code

public function setVariableData($name, TypedDataInterface $data) {
  $this->variables[$name] = $data;
  return $this;
}