function RulesComponent::getMetadataState

Gets the metadata state with all context definitions as variables in it.

Describes the metadata state before execution - only context definitions are set as variables.

Return value

\Drupal\rules\Context\ExecutionMetadataStateInterface The execution metadata state populated with context definitions.

2 calls to RulesComponent::getMetadataState()
RulesComponent::autocomplete in src/Engine/RulesComponent.php
Returns autocomplete results for the given partial selector.
RulesComponent::checkIntegrity in src/Engine/RulesComponent.php
Verifies that the given expression is valid with the defined context.

File

src/Engine/RulesComponent.php, line 302

Class

RulesComponent
Handles executable Rules components.

Namespace

Drupal\rules\Engine

Code

public function getMetadataState() {
    $data_definitions = [];
    foreach ($this->contextDefinitions as $name => $context_definition) {
        $data_definitions[$name] = $context_definition->getDataDefinition();
    }
    return ExecutionMetadataState::create($data_definitions);
}