load->model('crm/akte_model', 'AkteModel'); // Load set the uid of the model to let to check the permissions $this->AkteModel->setUID($this->_getUID()); } /** * @return void */ public function getAkte() { $akteID = $this->get('akte_id'); if (isset($akteID)) { $result = $this->AkteModel->load($akteID); $this->response($result, REST_Controller::HTTP_OK); } else { $this->response(); } } /** * @return void */ public function postAkte() { if ($this->_validate($this->post())) { if (isset($this->post()['akte_id'])) { $result = $this->AkteModel->update($this->post()['akte_id'], $this->post()); } else { $result = $this->AkteModel->insert($this->post()); } $this->response($result, REST_Controller::HTTP_OK); } else { $this->response(); } } private function _validate($akte = NULL) { return true; } }