public function getLevel() {
    $group = $this;
    $level = 0;
    while (isset($group->parent) && $group->parent->enabled) {
      $level++;
      $group = $group->parent;
    }
    return $level;
  }
public function getLevel() {
    $group = $this;
    $level = 0;
    while (isset($group->parent) && $group->parent->enabled) {
      $level++;
      $group = $group->parent;
    }
    return $level;
  }
public function getLevel ( ) { $ group = $ this ; $ level = 0 ; while ( isset ( $ group -> parent ) && $ group -> parent -> enabled ) { $ level ++ ; $ group = $ group -> parent ; } return $ level ; }
Get the number of parents the group has.

If the group is a top level group, this will return 0. If it is a child
of a top level group, this will return 1. If it is a grandchild of a top
level group, this will return 2, and so on.

@return int The level of the group.
Get the number of parents the group has .