You are here

public function ExpressionBase::getRoot in Rules 8.3

Returns the root expression if this expression is nested.

Return value

\Drupal\rules\Engine\ExpressionInterface The root expression or $this if the expression is the root element itself.

Overrides ExpressionInterface::getRoot

2 calls to ExpressionBase::getRoot()
RuleExpression::__clone in src/Plugin/RulesExpression/RuleExpression.php
PHP magic __clone function.
RuleExpression::__construct in src/Plugin/RulesExpression/RuleExpression.php
Constructs a new class instance.

File

src/Engine/ExpressionBase.php, line 127

Class

ExpressionBase
Base class for rules expressions.

Namespace

Drupal\rules\Engine

Code

public function getRoot() {
  if (isset($this->root)) {

    // @todo This seems to be the parent, not root.
    return $this->root
      ->getRoot();
  }
  return $this;
}