function ExpressionContainerBase::prepareExecutionMetadataState

Overrides ExpressionInterface::prepareExecutionMetadataState

File

src/Engine/ExpressionContainerBase.php, line 101

Class

ExpressionContainerBase
Common base class for action and condition expression containers.

Namespace

Drupal\rules\Engine

Code

public function prepareExecutionMetadataState(ExecutionMetadataStateInterface $metadata_state, ExpressionInterface $until = NULL, $apply_assertions = TRUE) {
    if ($until && $this->getUuid() === $until->getUuid()) {
        return TRUE;
    }
    $this->prepareExecutionMetadataStateBeforeTraversal($metadata_state);
    $apply_assertions = $apply_assertions && $this->allowsMetadataAssertions();
    foreach ($this as $child_expression) {
        $found = $child_expression->prepareExecutionMetadataState($metadata_state, $until, $apply_assertions);
        // If the expression was found, we need to stop.
        if ($found) {
            return TRUE;
        }
    }
    $this->prepareExecutionMetadataStateAfterTraversal($metadata_state);
}