HierarchyIterator.php
public function getParent()
    {
        $depth = $this->iterator->getDepth();

        return $depth === 0
            ? $this->id
            : $this->iterator->getSubIterator($depth - 1)->key();
    }
public function getParent()
    {
        $depth = $this->iterator->getDepth();

        return $depth === 0
            ? $this->id
            : $this->iterator->getSubIterator($depth - 1)->key();
    }
public function getParent ( ) { $ depth = $ this -> iterator -> getDepth ( ) ; return $ depth === 0 ? $ this -> id : $ this -> iterator -> getSubIterator ( $ depth - 1 ) -> key ( ) ; }
Return the parent element

@return mixed
Return the parent element