concrete/src/Page/Page.php
public static function getHomePageID($page = null)
    {
        if ($page) {
            if (!$page instanceof self) {
                $page = self::getByID($page);
            }
            if ($page instanceof Page) {
                $siteTree = $page->getSiteTreeObject();
                if ($siteTree !== null) {
                    return $siteTree->getSiteHomePageID();
                }
            }
        }
        $locale = Application::getFacadeApplication()->make(LocaleService::class)->getDefaultLocale();
        if ($locale !== null) {
            $siteTree = $locale->getSiteTreeObject();
            if ($siteTree != null) {
                return $siteTree->getSiteHomePageID();
            }
        }

        return null;
    }
public static function getHomePageID($page = null)
    {
        if ($page) {
            if (!$page instanceof self) {
                $page = self::getByID($page);
            }
            if ($page instanceof Page) {
                $siteTree = $page->getSiteTreeObject();
                if ($siteTree !== null) {
                    return $siteTree->getSiteHomePageID();
                }
            }
        }
        $locale = Application::getFacadeApplication()->make(LocaleService::class)->getDefaultLocale();
        if ($locale !== null) {
            $siteTree = $locale->getSiteTreeObject();
            if ($siteTree != null) {
                return $siteTree->getSiteHomePageID();
            }
        }

        return null;
    }
public static function getHomePageID ( $ page = null ) { if ( $ page ) { if ( ! $ page instanceof self ) { $ page = self :: getByID ( $ page ) ; } if ( $ page instanceof Page ) { $ siteTree = $ page -> getSiteTreeObject ( ) ; if ( $ siteTree !== null ) { return $ siteTree -> getSiteHomePageID ( ) ; } } } $ locale = Application :: getFacadeApplication ( ) -> make ( LocaleService :: class ) -> getDefaultLocale ( ) ; if ( $ locale !== null ) { $ siteTree = $ locale -> getSiteTreeObject ( ) ; if ( $ siteTree != null ) { return $ siteTree -> getSiteHomePageID ( ) ; } } return null ; }
Get the ID of the home page.

@param Page|int $page the page (or its ID) for which you want the home (if not specified, we'll use the default locale site tree)

@return int|null returns NULL if $page is null (or it doesn't have a SiteTree associated) and if there's no default locale
Get the ID of the home page .