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

getMenu() public method

public getMenu ( integer $pageUid, array $excludePages = [], boolean $includeNotInMenu = false, boolean $includeMenuSeparator = false, boolean $disableGroupAccessCheck = false ) : array
$pageUid integer
$excludePages array
$includeNotInMenu boolean
$includeMenuSeparator boolean
$disableGroupAccessCheck boolean
return array
    public function getMenu($pageUid, array $excludePages = [], $includeNotInMenu = false, $includeMenuSeparator = false, $disableGroupAccessCheck = false)
    {
        $pageRepository = $this->getPageRepository();
        $pageConstraints = $this->getPageConstraints($excludePages, $includeNotInMenu, $includeMenuSeparator);
        $cacheKey = md5($pageUid . $pageConstraints . (int) $disableGroupAccessCheck);
        if (false === isset(static::$cachedMenus[$cacheKey])) {
            if (true === (bool) $disableGroupAccessCheck) {
                $pageRepository->where_groupAccess = '';
            }
            static::$cachedMenus[$cacheKey] = $pageRepository->getMenu($pageUid, '*', 'sorting', $pageConstraints);
        }
        return static::$cachedMenus[$cacheKey];
    }

Usage Example

Esempio n. 1
0
 /**
  * @param array $arguments
  * @return boolean
  */
 protected static function evaluateCondition($arguments = null)
 {
     $pageUid = $arguments['pageUid'];
     $includeHiddenInMenu = (bool) $arguments['includeHiddenInMenu'];
     $includeAccessProtected = (bool) $arguments['includeAccessProtected'];
     if (null === $pageUid || true === empty($pageUid) || 0 === (int) $pageUid) {
         $pageUid = $GLOBALS['TSFE']->id;
     }
     if (self::$pageService === null) {
         $objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
         self::$pageService = $objectManager->get('FluidTYPO3\\Vhs\\Service\\PageService');
     }
     $menu = self::$pageService->getMenu($pageUid, [], $includeHiddenInMenu, false, $includeAccessProtected);
     return 0 < count($menu);
 }
All Usage Examples Of FluidTYPO3\Vhs\Service\PageService::getMenu