function ConditionExpressionContainer::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/ConditionExpressionContainer.php, line 158

Class

ConditionExpressionContainer
Container for conditions.

Namespace

Drupal\rules\Engine

Code

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