public function update() { $id = $this->request->get('id'); $name = $this->request->get('name'); $item = CompanyTable::get($id); if ($item) { $item->name = $name; $item->update(); $this->server->sendOK(); } else { $this->server->sendNotFound(); } }
public function get() { $data = CompanyTable::getAll(); $this->server->sendData($data); }