function ConditionExpression::prepareExecutionMetadataState

Overrides ExpressionInterface::prepareExecutionMetadataState

1 call to ConditionExpression::prepareExecutionMetadataState()
ConditionExpression::checkIntegrity in src/Plugin/RulesExpression/ConditionExpression.php
Verifies that this expression is configured correctly.

File

src/Plugin/RulesExpression/ConditionExpression.php, line 210

Class

ConditionExpression
Defines an executable condition expression.

Namespace

Drupal\rules\Plugin\RulesExpression

Code

public function prepareExecutionMetadataState(ExecutionMetadataStateInterface $metadata_state, ExpressionInterface $until = NULL, $apply_assertions = TRUE) {
    if ($until && $this->getUuid() === $until->getUuid()) {
        return TRUE;
    }
    $condition = $this->conditionManager
        ->createInstance($this->configuration['condition_id'], [
        'negate' => $this->configuration['negate'],
    ]);
    // Make sure to refine context first, such that possibly refined definitions
    // of provided context are respected.
    $this->prepareContextWithMetadata($condition, $metadata_state);
    $this->addProvidedContextDefinitions($condition, $metadata_state);
    if ($apply_assertions && !$this->isNegated()) {
        $this->assertMetadata($condition, $metadata_state);
    }
}