protected function getAnchorsInPage($id)
    {
        $page = SiteTree::get()->byID($id);

        if (!$page || !$page->canView()) {
            return [];
        }

        return $page->getAnchorsOnPage();
    }