public function getIsRootPageId($pageId)
    {
        // Page 0 can never be a root page
        if ($pageId === 0) {
            return false;
        }

        // Page -1 is a workspace thing
        if ($pageId === -1) {
            return false;
        }

        $cacheId = 'RootPageResolver' . '_' . 'getIsRootPageId' . '_' . $pageId;
        $isSiteRoot = $this->runtimeCache->get($cacheId);

        if (!empty($isSiteRoot)) {
            return $isSiteRoot;
        }

        $page = $this->getPageRecordByPageId($pageId);
        if (empty($page)) {
            throw new \InvalidArgumentException(
                'The page for the given page ID \'' . $pageId
                . '\' could not be found in the database and can therefore not be used as site root page.',
                1487171426
            );
        }

        $isSiteRoot = Site::isRootPage($page);
        $this->runtimeCache->set($cacheId, $isSiteRoot);

        return $isSiteRoot;
    }
public function getIsRootPageId($pageId)
    {
        // Page 0 can never be a root page
        if ($pageId === 0) {
            return false;
        }

        // Page -1 is a workspace thing
        if ($pageId === -1) {
            return false;
        }

        $cacheId = 'RootPageResolver' . '_' . 'getIsRootPageId' . '_' . $pageId;
        $isSiteRoot = $this->runtimeCache->get($cacheId);

        if (!empty($isSiteRoot)) {
            return $isSiteRoot;
        }

        $page = $this->getPageRecordByPageId($pageId);
        if (empty($page)) {
            throw new \InvalidArgumentException(
                'The page for the given page ID \'' . $pageId
                . '\' could not be found in the database and can therefore not be used as site root page.',
                1487171426
            );
        }

        $isSiteRoot = Site::isRootPage($page);
        $this->runtimeCache->set($cacheId, $isSiteRoot);

        return $isSiteRoot;
    }
public function getIsRootPageId ( $ pageId ) { // Page 0 can never be a root page if ( $ pageId === 0 ) { return false ; } // Page -1 is a workspace thing if ( $ pageId === - 1 ) { return false ; } $ cacheId = 'RootPageResolver' . '_' . 'getIsRootPageId' . '_' . $ pageId ; $ isSiteRoot = $ this -> runtimeCache -> get ( $ cacheId ) ; if ( ! empty ( $ isSiteRoot ) ) { return $ isSiteRoot ; } $ page = $ this -> getPageRecordByPageId ( $ pageId ) ; if ( empty ( $ page ) ) { throw new \ InvalidArgumentException ( 'The page for the given page ID \'' . $ pageId . '\' could not be found in the database and can therefore not be used as site root page.' , 1487171426 ) ; } $ isSiteRoot = Site :: isRootPage ( $ page ) ; $ this -> runtimeCache -> set ( $ cacheId , $ isSiteRoot ) ; return $ isSiteRoot ; }
Checks if the passed pageId is a root page.

@param int $pageId Page ID
@return bool TRUE if the page is marked as root page, FALSE otherwise
Checks if the passed pageId is a root page .