public function createFolder($name, $title, array $children, $headScript = '')
 {
     if (empty($name)) {
         throw new \Exception('Folder name must be set');
     }
     if (empty($title)) {
         $title = $name;
     }
     $page = new PageBuilder();
     $page->setName($name);
     $page->setTitle($title);
     $page->setTemplateType('default');
     $page->setIsFolder(true);
     $page->setHeadScript($headScript);
     $page->setChildPages($children);
     $this->pages[$name] = $page;
     return $page;
 }
 private function setFooter(PageBuilder $page, $siteRef)
 {
     if (null === ($footerId = $page->getFooterId())) {
         return;
     }
     $addFooterCmd = $this->apiClient->getCommand('Updatestaticvaluesforastaticwidget', array('siteRef' => $siteRef, 'staticWidgetId' => $footerId, 'values' => array('content' => $page->getFooterContent())));
     $addFooterCmd->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());
 }