Created
October 15, 2017 10:04
-
-
Save derhansen/ff8f7094f8124a3fa94648b5e93bbf1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function getRootPage($uid) | |
{ | |
/** @var PageRepository $pageRepository */ | |
$pageRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(PageRepository::class); | |
$rootLinePages = $pageRepository->getRootLine($uid); | |
$rootPage = null; | |
foreach ($rootLinePages as $page) { | |
if ($page['is_siteroot'] === '1') { | |
$rootPage = $page; | |
break; | |
} | |
} | |
return $rootPage; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment