|
@@ -117,16 +117,13 @@ class OtPageRepository
|
|
|
/**
|
|
/**
|
|
|
* Returns all the pages of the given page's website, starting from the root page
|
|
* Returns all the pages of the given page's website, starting from the root page
|
|
|
*
|
|
*
|
|
|
- * @param int $pageUid The uid of the page
|
|
|
|
|
|
|
+ * @param int $rootUid
|
|
|
* @param bool $withRestrictions Set to true to add the standard restrictions (deleted, forbidden...etc.)
|
|
* @param bool $withRestrictions Set to true to add the standard restrictions (deleted, forbidden...etc.)
|
|
|
* @return array
|
|
* @return array
|
|
|
*/
|
|
*/
|
|
|
- public function getAllSitePages(int $pageUid, bool $withRestrictions=false) {
|
|
|
|
|
- $rootPage = $this->getRootPageFor($pageUid);
|
|
|
|
|
- if (!$rootPage) {
|
|
|
|
|
- return [];
|
|
|
|
|
- }
|
|
|
|
|
- return array_merge([$rootPage], $this->getAllSubpagesForPage($rootPage['uid']));
|
|
|
|
|
|
|
+ public function getAllSitePages(int $rootUid, bool $withRestrictions=false): array
|
|
|
|
|
+ {
|
|
|
|
|
+ return array_merge([$this->getPage($rootUid)], $this->getAllSubpagesForPage($rootUid));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -234,6 +231,6 @@ class OtPageRepository
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function getPage(int $uid) {
|
|
public function getPage(int $uid) {
|
|
|
- return $this->pageRepository->getPage($uid);
|
|
|
|
|
|
|
+ return $this->pageRepository->getPage($uid, true);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|