get_form_tree() public method

Recursively build path to this element (e.g. array(grandparent, parent, this) )
public get_form_tree ( ) : array
return array of parents
 /**
  * Recursively build path to this element (e.g. array(grandparent, parent, this) )
  * @return array of parents
  */
 public function get_form_tree()
 {
     $tree = array();
     if ($this->parent) {
         $tree = $this->parent->get_form_tree();
     }
     $tree[] = $this;
     return $tree;
 }