function saveScheme() { $response = new Response(); try { $name = $this->input->post("scheme-name"); $divisionId = $this->input->post("division"); $scheme = new Scheme(); $scheme->setCreated(new DateTime()); $scheme->setName($name); $division = $this->findById("Division", $divisionId); $scheme->setDivision($division); $this->save($scheme); } catch (Exception $e) { $response->setStatus(false); $response->setErrorMessage($e->getMessage()); } $this->output->set_content_type('application/json')->set_output(json_encode($response)); }
public function setDivision($division) { $this->__load(); return parent::setDivision($division); }