function ConditionExpressionContainer::getExpression

Looks up the expression by UUID in this container.

Parameters

string $uuid: The UUID of the expression.

Return value

\Drupal\rules\Engine\ExpressionInterface|false The expression object or FALSE if not expression object with that UUID could be found.

Overrides ExpressionContainerInterface::getExpression

1 call to ConditionExpressionContainer::getExpression()
ConditionExpressionContainer::addExpressionObject in src/Engine/ConditionExpressionContainer.php
Adds an expression object.

File

src/Engine/ConditionExpressionContainer.php, line 140

Class

ConditionExpressionContainer
Container for conditions.

Namespace

Drupal\rules\Engine

Code

public function getExpression($uuid) {
  foreach ($this->conditions as $condition) {
    if ($condition->getUuid() === $uuid) {
      return $condition;
    }
    if ($condition instanceof ExpressionContainerInterface) {
      $nested_condition = $condition->getExpression($uuid);
      if ($nested_condition) {
        return $nested_condition;
      }
    }
  }
  return FALSE;
}