function RulesPlugin::depth

Returns the depth of this element in the configuration.

File

includes/rules.core.inc, line 588

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;
}