public function getParent()
    {
        $section = $this->getSection();
        if ($this->hasMainSection()) {
            if ($section->isRoot()) {
                return null;
            } elseif ($section->getParent() instanceof Section) {
                return $section->getParent()->getPage();
            } else {
                return null;
            }
        }

        return $section->getPage();
    }
public function getParent()
    {
        $section = $this->getSection();
        if ($this->hasMainSection()) {
            if ($section->isRoot()) {
                return null;
            } elseif ($section->getParent() instanceof Section) {
                return $section->getParent()->getPage();
            } else {
                return null;
            }
        }

        return $section->getPage();
    }
public function getParent ( ) { $ section = $ this -> getSection ( ) ; if ( $ this -> hasMainSection ( ) ) { if ( $ section -> isRoot ( ) ) { return null ; } elseif ( $ section -> getParent ( ) instanceof Section ) { return $ section -> getParent ( ) -> getPage ( ) ; } else { return null ; } } return $ section -> getPage ( ) ; }
Returns the parent page, null if this page is root.

@return Page|null
Returns the parent page null if this page is root .