load->model('nation_model', 'NationModel'); // Load set the addonID of the model to let to check the permissions $this->NationModel->setAddonID($this->_getAddonID()); } public function getAll() { $result = $this->NationModel->getAll($this->get('ohnesperre'), $this->get('orderEnglish')); if(is_object($result)) { $payload = [ 'success' => TRUE, 'message' => 'Nation found', 'data' => $result->result() ]; $httpstatus = REST_Controller::HTTP_OK; } else { $payload = [ 'success' => FALSE, 'message' => 'Nation not found' ]; $httpstatus = REST_Controller::HTTP_OK; } $this->response($payload, $httpstatus); } public function getBundesland() { $result = $this->NationModel->getBundesland(); if(is_object($result)) { $payload = [ 'success' => TRUE, 'message' => 'Bundesland found', 'data' => $result->result() ]; $httpstatus = REST_Controller::HTTP_OK; } else { $payload = [ 'success' => FALSE, 'message' => 'Bundesland not found' ]; $httpstatus = REST_Controller::HTTP_OK; } $this->response($payload, $httpstatus); } }