Ejemplo n.º 1
0
 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();
     }
 }
Ejemplo n.º 2
0
 public function get()
 {
     $data = CompanyTable::getAll();
     $this->server->sendData($data);
 }