FluidTYPO3\Vhs\Service\PageService::getRootLine PHP Method

getRootLine() public method

public getRootLine ( integer $pageUid = null, boolean $reverse = false, boolean $disableGroupAccessCheck = false ) : array
$pageUid integer
$reverse boolean
$disableGroupAccessCheck boolean
return array
    public function getRootLine($pageUid = null, $reverse = false, $disableGroupAccessCheck = false)
    {
        if (null === $pageUid) {
            $pageUid = $GLOBALS['TSFE']->id;
        }
        $cacheKey = md5($pageUid . (int) $reverse . (int) $disableGroupAccessCheck);
        if (false === isset(static::$cachedRootlines[$cacheKey])) {
            $pageRepository = $this->getPageRepository();
            if (true === (bool) $disableGroupAccessCheck) {
                $pageRepository->where_groupAccess = '';
            }
            $rootline = $pageRepository->getRootLine($pageUid);
            if (true === $reverse) {
                $rootline = array_reverse($rootline);
            }
            static::$cachedRootlines[$cacheKey] = $rootline;
        }
        return static::$cachedRootlines[$cacheKey];
    }

Usage Example

Beispiel #1
0
 /**
  * @return mixed
  */
 public function render()
 {
     $pageUid = (int) $this->arguments['pageUid'];
     if (0 === $pageUid) {
         $pageUid = $GLOBALS['TSFE']->id;
     }
     $rootLineData = $this->pageService->getRootLine($pageUid);
     return $this->renderChildrenWithVariableOrReturnInput($rootLineData);
 }
All Usage Examples Of FluidTYPO3\Vhs\Service\PageService::getRootLine