/**
  * @param int $id
  *
  * @return bool|FrontendPage
  */
 protected function getPage($id)
 {
     try {
         return FrontendPage::findById($id, [FrontendPage::STATUS_HIDDEN, FrontendPage::STATUS_DRAFT]);
     } catch (ModelNotFoundException $e) {
         $this->throwFailException($this->smartRedirect()->withErrors(trans('pages::core.messages.not_found')));
     }
 }
예제 #2
0
 /**
  * @param string $value
  *
  * @return void
  */
 private function execute($value)
 {
     if (empty($value)) {
         return;
     }
     // Производим поиск страницы которая укзана в настройках типа страницы
     if (!empty($itemPageId = $this->getSettings()->getSetting('item_page_id'))) {
         $this->page = FrontendPage::findById($itemPageId);
         return;
     }
 }
예제 #3
0
 /**
  * @return bool|FrontendPage
  */
 public function toFrontendPage()
 {
     return FrontendPage::findById($this->id);
 }
예제 #4
0
 public function onLoad()
 {
     $this->currentPage = FrontendPage::findById($this->getPageId());
 }