private function get_faq_question(HTTPRequestCustom $request) { $id = $request->get_int('id', 0); if (!empty($id)) { try { $this->faq_question = FaqService::get_question('WHERE id=:id', array('id' => $id)); } catch (RowNotFoundException $e) { } } }
private function get_faq_question(HTTPRequestCustom $request) { $id = $request->get_int('id', 0); if (!empty($id)) { try { return FaqService::get_question('WHERE id=:id', array('id' => $id)); } catch (RowNotFoundException $e) { $error_controller = PHPBoostErrors::unexisting_page(); DispatchManager::redirect($error_controller); } } }
private function get_faq_question() { if ($this->faq_question === null) { $id = AppContext::get_request()->get_getint('id', 0); if (!empty($id)) { try { $this->faq_question = FaqService::get_question('WHERE id=:id', array('id' => $id)); } catch (RowNotFoundException $e) { $error_controller = PHPBoostErrors::unexisting_page(); DispatchManager::redirect($error_controller); } } else { $this->is_new_faq_question = true; $this->faq_question = new FaqQuestion(); $this->faq_question->init_default_properties(AppContext::get_request()->get_getint('id_category', Category::ROOT_CATEGORY)); } } return $this->faq_question; }