load->model('codex/bisfunktion_model', 'BisfunktionModel'); // Load set the uid of the model to let to check the permissions $this->BisfunktionModel->setUID($this->_getUID()); } /** * @return void */ public function getBisfunktion() { $bisfunktionID = $this->get('bisfunktion_id'); if(isset($bisfunktionID)) { $result = $this->BisfunktionModel->load($bisfunktionID); $this->response($result, REST_Controller::HTTP_OK); } else { $this->response(); } } /** * @return void */ public function postBisfunktion() { if($this->_validate($this->post())) { if(isset($this->post()['bisfunktion_id'])) { $result = $this->BisfunktionModel->update($this->post()['bisfunktion_id'], $this->post()); } else { $result = $this->BisfunktionModel->insert($this->post()); } $this->response($result, REST_Controller::HTTP_OK); } else { $this->response(); } } private function _validate($bisfunktion = NULL) { return true; } }