Exemplo n.º 1
0
 public function writeFolder(PageBuilder $page, $siteRef)
 {
     $data = array('menu' => 0, 'siteRef' => $siteRef, 'pageUrl' => $page->getName(), 'seo_title' => $page->getSeoTitle(), 'description' => $page->getDescription(), 'status' => 'active', 'title' => $page->getTitle(), 'type' => 'folder', 'folder' => 0, 'headscript' => $page->getHeadScript(), 'templateType' => 'default');
     $createFolderCmd = $this->apiClient->getCommand('CreateSitePage', $data);
     $response = $createFolderCmd->execute();
     $folderRef = $response['page']['ref'];
     $parentId = $response['page']['parentId'];
     $page->setPageRef($folderRef);
     $page->setParentId($parentId);
     $page->updateChildParentIds();
     $this->createCollection($page->getCollection(), $siteRef, $folderRef);
     $updatePageCmd = $this->apiClient->getCommand('UpdateSitePage', array('siteRef' => $siteRef, 'pageRef' => $folderRef, 'title' => $page->getTitle()));
     $updatePageCmd->execute();
 }
 public function writePage(PageBuilder $page, $siteRef)
 {
     print "Page: ref = {$page->getPageRef()}, name = {$page->getName()}, title = {$page->getTitle()}" . PHP_EOL;
     $this->writeCollection($page->getCollection(), $siteRef, $page->getPageRef());
 }