load->model('codex/nation_model', 'NationModel'); // Load set the uid of the model to let to check the permissions $this->NationModel->setUID($this->_getUID()); } public function getAll() { if (!$this->get('orderEnglish')) { $result = $this->NationModel->addOrder('kurztext'); } else { $result = $this->NationModel->addOrder('engltext'); } if ($result->error == EXIT_SUCCESS) { if ($this->get('ohnesperre')) { $result = $this->NationModel->loadWhere('sperre IS NULL'); } else { $result = $this->NationModel->loadWhole(); } } $this->response($result, REST_Controller::HTTP_OK); } }