/** * @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'))); } }
/** * @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; } }
/** * @return bool|FrontendPage */ public function toFrontendPage() { return FrontendPage::findById($this->id); }
public function onLoad() { $this->currentPage = FrontendPage::findById($this->getPageId()); }