Пример #1
0
 public static function getByPageTypeComposerFormLayoutSetControl(Template $pt, PageTypeComposerFormLayoutSetControl $control)
 {
     $db = Loader::db();
     $ptComposerOutputControlID = $db->GetOne('select ptComposerOutputControlID from PageTypeComposerOutputControls where pTemplateID = ? and ptComposerFormLayoutSetControlID = ?', array($pt->getPageTemplateID(), $control->getPageTypeComposerFormLayoutSetControlID()));
     if ($ptComposerOutputControlID) {
         return static::getByID($ptComposerOutputControlID);
     }
 }
Пример #2
0
 public function addHomePage(Locale $locale, Template $template, $name, $url_slug = null)
 {
     $tree = $locale->getSiteTree();
     $home = Page::addHomePage($tree);
     $tree->setLocale($locale);
     $tree->setSiteHomePageID($home->getCollectionID());
     $this->entityManager->persist($tree);
     $this->entityManager->flush();
     $home->update(['cName' => $name, 'pTemplateID' => $template->getPageTemplateID(), 'cHandle' => $url_slug ? $url_slug : $locale->getLocale()]);
     $home->rescanCollectionPath();
     return $home;
 }
Пример #3
0
 /**
  * Filters by page template.
  *
  * @param mixed $ptHandle
  */
 public function filterByPageTemplate(TemplateEntity $template)
 {
     $this->query->andWhere('cv.pTemplateID = :pTemplateID');
     $this->query->setParameter('pTemplateID', $template->getPageTemplateID());
 }
Пример #4
0
 /**
  * Called from previewing functions, this lets us override the page's template with one of our own choosing.
  */
 public function setCustomPageTemplate(Template $pt)
 {
     $this->pTemplateID = $pt->getPageTemplateID();
 }
 public function getPageTypeComposerOutputControlObject(Template $pt)
 {
     $app = Application::getFacadeApplication();
     $db = $app->make('database')->connection();
     $ptComposerOutputControlID = $db->fetchColumn('select ptComposerOutputControlID from PageTypeComposerOutputControls where ptComposerFormLayoutSetControlID = ? and pTemplateID = ?', [$this->ptComposerFormLayoutSetControlID, $pt->getPageTemplateID()]);
     if ($ptComposerOutputControlID) {
         return PageTypeComposerOutputControl::getByID($ptComposerOutputControlID);
     }
 }