You are here

public function ActionExpressionContainer::getExpression in Rules 8.3

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 ActionExpressionContainer::getExpression()
ActionExpressionContainer::addExpressionObject in src/Engine/ActionExpressionContainer.php
Adds an expression object.

File

src/Engine/ActionExpressionContainer.php, line 111

Class

ActionExpressionContainer
Container for actions.

Namespace

Drupal\rules\Engine

Code

public function getExpression($uuid) {
  foreach ($this->actions as $action) {
    if ($action
      ->getUuid() === $uuid) {
      return $action;
    }
    if ($action instanceof ExpressionContainerInterface) {
      $nested_action = $action
        ->getExpression($uuid);
      if ($nested_action) {
        return $nested_action;
      }
    }
  }
  return FALSE;
}