コード例 #1
0
 private function get_shoutbox_message(HTTPRequestCustom $request)
 {
     $id = $request->get_int('id', 0);
     if (!empty($id)) {
         try {
             $this->shoutbox_message = ShoutboxService::get_message('WHERE id=:id', array('id' => $id));
         } catch (RowNotFoundException $e) {
         }
     }
 }
コード例 #2
0
 private function get_message(HTTPRequestCustom $request)
 {
     $id = $request->get_getint('id', 0);
     if (!empty($id)) {
         try {
             return ShoutboxService::get_message('WHERE id=:id', array('id' => $id));
         } catch (RowNotFoundException $e) {
             $error_controller = PHPBoostErrors::unexisting_page();
             DispatchManager::redirect($error_controller);
         }
     }
 }
コード例 #3
0
 private function get_message()
 {
     if ($this->message === null) {
         $id = AppContext::get_request()->get_getint('id', 0);
         if (!empty($id)) {
             try {
                 $this->message = ShoutboxService::get_message('WHERE id=:id', array('id' => $id));
             } catch (RowNotFoundException $e) {
                 $error_controller = PHPBoostErrors::unexisting_page();
                 DispatchManager::redirect($error_controller);
             }
         } else {
             $this->is_new_message = true;
             $this->message = new ShoutboxMessage();
             $this->message->init_default_properties();
         }
     }
     return $this->message;
 }