function ActionExpressionContainer::deleteExpression

Deletes an expression identified by the specified UUID in the container.

Parameters

string $uuid: The UUID of the expression.

Return value

bool TRUE if an expression was deleted, FALSE if no expression with that UUID was found.

Overrides ExpressionContainerInterface::deleteExpression

File

src/Engine/ActionExpressionContainer.php, line 129

Class

ActionExpressionContainer
Container for actions.

Namespace

Drupal\rules\Engine

Code

public function deleteExpression($uuid) {
  foreach ($this->actions as $index => $action) {
    if ($action->getUuid() === $uuid) {
      unset($this->actions[$index]);
      return TRUE;
    }
    if ($action instanceof ExpressionContainerInterface && $action->deleteExpression($uuid)) {
      return TRUE;
    }
  }
  return FALSE;
}