protected function determineParentPageUid($pageUid = null, $entryLevel = 0) { $rootLineData = $this->pageService->getRootLine(); if (null === $pageUid) { if (null !== $entryLevel) { if ($entryLevel < 0) { $entryLevel = count($rootLineData) - 1 + $entryLevel; } $pageUid = $rootLineData[$entryLevel]['uid']; } else { $pageUid = $GLOBALS['TSFE']->id; } } return $pageUid; }