public function isDescendantOf(Page $page, $strict = true)
    {
        if ($this === $page) {
            return !$strict;
        }

        if (!$this->hasMainSection()) {
            return $page === $this->getParent() || $this->getSection()->isDescendantOf($page->getSection());
        }

        return $this->getSection()->isDescendantOf($page->getSection(), $strict);
    }
public function isDescendantOf(Page $page, $strict = true)
    {
        if ($this === $page) {
            return !$strict;
        }

        if (!$this->hasMainSection()) {
            return $page === $this->getParent() || $this->getSection()->isDescendantOf($page->getSection());
        }

        return $this->getSection()->isDescendantOf($page->getSection(), $strict);
    }
public function isDescendantOf ( Page $ page , $ strict = true ) { if ( $ this === $ page ) { return ! $ strict ; } if ( ! $ this -> hasMainSection ( ) ) { return $ page === $ this -> getParent ( ) || $ this -> getSection ( ) -> isDescendantOf ( $ page -> getSection ( ) ) ; } return $ this -> getSection ( ) -> isDescendantOf ( $ page -> getSection ( ) , $ strict ) ; }
Is this page is a descendant of the provided one?

@param  Page                 $page
@param  boolean              $strict             Optional, if truz (default) this page is excluded of descendants list.

@return boolean                                  True if this page is a descendant of provided page, false otherwise.
Is this page is a descendant of the provided one?