public function getRoot()
    {
        $next_parent = $this->getParent();
        $parent = null;
        while ($next_parent) {
            $parent = $next_parent;
            $next_parent = $parent->getParent();
        }

        return $parent ? $parent : $this;
    }
public function getRoot()
    {
        $next_parent = $this->getParent();
        $parent = null;
        while ($next_parent) {
            $parent = $next_parent;
            $next_parent = $parent->getParent();
        }

        return $parent ? $parent : $this;
    }
public function getRoot ( ) { $ next_parent = $ this -> getParent ( ) ; $ parent = null ; while ( $ next_parent ) { $ parent = $ next_parent ; $ next_parent = $ parent -> getParent ( ) ; } return $ parent ? $ parent : $ this ; }
Returns the type's root-parent, if it has one.

@return EntityTypeInterface
Returns the type s root - parent if it has one .