public function getAncestorsNames()
    {
        $names = [];
        if ($this->hasParent()) {
            $names = $this->getParent()->getAncestorsNames();
        }
        $names[] = $this->getName();
        return $names;
    }
public function getAncestorsNames()
    {
        $names = [];
        if ($this->hasParent()) {
            $names = $this->getParent()->getAncestorsNames();
        }
        $names[] = $this->getName();
        return $names;
    }
public function getAncestorsNames ( ) { $ names = [ ] ; if ( $ this -> hasParent ( ) ) { $ names = $ this -> getParent ( ) -> getAncestorsNames ( ) ; } $ names [ ] = $ this -> getName ( ) ; return $ names ; }
Get all ancestors names.
It includes the name of the object itself.

@return array
Get all ancestors names . It includes the name of the object itself .