예제 #1
0
 public function movePage($page, $newParentPage, $previousSiblingPage = null)
 {
     if ($previousSiblingPage !== null) {
         $this->pageRepository->persistAsNextSiblingOf($page, $previousSiblingPage);
     } else {
         $this->pageRepository->persistAsFirstChildOf($page, $newParentPage);
     }
     $this->objectManager->flush();
 }
예제 #2
0
 public function exportWebsite(Workspace $workspace, &$files, Website $object)
 {
     //Getting all website pages and building array
     $rootWebsitePage = $object->getRoot();
     $websitePages = $this->websitePageRepository->children($rootWebsitePage);
     array_unshift($websitePages, $rootWebsitePage);
     $websitePagesArray = array();
     foreach ($websitePages as $websitePage) {
         $websitePagesArray[] = $websitePage->exportToArray($this->router, $files);
     }
     $websiteOptionsArray = $object->getOptions()->exportToArray($this->webDir, $files);
     $data = array('options' => $websiteOptionsArray, 'pages' => $websitePagesArray);
     return $data;
 }