Пример #1
0
 /**
  * @param int $pId
  * @param string $pagesToExclude
  * @return string
  */
 public function render($pId, $pagesToExclude)
 {
     $pagesToExclude = array_map('trim', explode(',', $pagesToExclude));
     $pagesToReturn = array();
     /** @var Page[] $pages */
     $pages = PageRepository::create()->findPagesByPid($pId);
     foreach ($pages as $page) {
         if (!in_array($page->getUid(), $pagesToExclude)) {
             $pagesToReturn[] = $page;
         }
     }
     return $pagesToReturn;
 }
Пример #2
0
 /**
  * @param $uid
  * @return int
  */
 private function getRecursiveRootpageId($uid)
 {
     /** @var Page $page */
     $page = $this->pageRepository->findByUid($uid);
     if ($page) {
         if ($page->getPid() == 0) {
             return $page->getUid();
         }
         if ($page->getIsSiteroot() == 0) {
             return $this->getRecursiveRootpageId($page->getPid());
         }
     }
     return $page->getUid();
 }
Пример #3
0
 /**
  * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
  */
 public function getSubpages()
 {
     if (is_null($this->subPages)) {
         $this->subPages = PageRepository::create()->findPagesByPid($this->getUid());
     }
     return $this->subPages;
 }