load->model('system/Thread_model', 'ThreadModel'); } /** * @return void */ public function getThread() { $threadID = $this->get('thread_id'); if (isset($threadID)) { $result = $this->ThreadModel->load($threadID); $this->response($result, REST_Controller::HTTP_OK); } else { $this->response(); } } /** * @return void */ public function postThread() { if ($this->_validate($this->post())) { if (isset($this->post()['thread_id'])) { $result = $this->ThreadModel->update($this->post()['thread_id'], $this->post()); } else { $result = $this->ThreadModel->insert($this->post()); } $this->response($result, REST_Controller::HTTP_OK); } else { $this->response(); } } private function _validate($thread = NULL) { return true; } }