public function getParents()
    {
        $parents = [];
        if ($this->parent && !$this->parent instanceof Root) {
            $parents = $this->parent->getParents();
            $parents[] = $this->parent;
        }

        return $parents;
    }
public function getParents()
    {
        $parents = [];
        if ($this->parent && !$this->parent instanceof Root) {
            $parents = $this->parent->getParents();
            $parents[] = $this->parent;
        }

        return $parents;
    }
public function getParents ( ) { $ parents = [ ] ; if ( $ this -> parent && ! $ this -> parent instanceof Root ) { $ parents = $ this -> parent -> getParents ( ) ; $ parents [ ] = $ this -> parent ; } return $ parents ; }
Return all parents starting with the root

@return Directory[]
Return all parents starting with the root