You are here

public function RulesPlugin::depth in Rules 7.2

Returns the depth of this element in the configuration.

File

includes/rules.core.inc, line 587
Rules base classes and interfaces needed for any rule evaluation.

Class

RulesPlugin
Base class for rules plugins.

Code

public function depth() {
  $element = $this;
  $i = 0;
  while (!empty($element->parent)) {
    $element = $element->parent;
    $i++;
  }
  return $i;
}