function RuleExpression::prepareExecutionMetadataState

Overrides ExpressionInterface::prepareExecutionMetadataState

File

src/Plugin/RulesExpression/RuleExpression.php, line 252

Class

RuleExpression
Provides a rule, executing actions when conditions are met.

Namespace

Drupal\rules\Plugin\RulesExpression

Code

public function prepareExecutionMetadataState(ExecutionMetadataStateInterface $metadata_state, ExpressionInterface $until = NULL, $apply_assertions = TRUE) {
    // @todo If the rule is nested, we may not pass assertions to following
    // expressions as we do not know whether the rule fires at all. Should we
    // clone the metadata state to ensure modifications stay local?
    $found = $this->conditions
        ->prepareExecutionMetadataState($metadata_state, $until, $apply_assertions);
    if ($found) {
        return TRUE;
    }
    return $this->actions
        ->prepareExecutionMetadataState($metadata_state, $until, $apply_assertions);
}