load->model('ressource/ort_model', 'OrtModel'); // Load set the uid of the model to let to check the permissions $this->OrtModel->setUID($this->_getUID()); } /** * @return void */ public function getOrt() { $ort_kurzbz = $this->get('ort_kurzbz'); if(isset($ort_kurzbz)) { $result = $this->OrtModel->load($ort_kurzbz); $this->response($result, REST_Controller::HTTP_OK); } else { $this->response(); } } /** * @return void */ public function postOrt() { if($this->_validate($this->post())) { if(isset($this->post()['ort_kurzbz'])) { $result = $this->OrtModel->update($this->post()['ort_kurzbz'], $this->post()); } else { $result = $this->OrtModel->insert($this->post()); } $this->response($result, REST_Controller::HTTP_OK); } else { $this->response(); } } private function _validate($ort = NULL) { return true; } }