X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/examples/writer/remote/app/controllers/users.php diff --git a/examples/writer/remote/app/controllers/users.php b/examples/writer/remote/app/controllers/users.php index 58d9c4e4..b28b717e 100644 --- a/examples/writer/remote/app/controllers/users.php +++ b/examples/writer/remote/app/controllers/users.php @@ -47,7 +47,7 @@ class Users extends ApplicationController { public function update() { $res = new Response(); - if (!get_class($this->params)) { + if (is_array($this->params)) { $res->data = array(); foreach ($this->params as $data) { if ($rec = User::update($data->id, $data)) { @@ -82,18 +82,17 @@ class Users extends ApplicationController { */ public function destroy() { $res = new Response(); - if (is_array($this->params)) { $destroyed = array(); - foreach ($this->params as $id) { - if ($rec = User::destroy($id)) { + foreach ($this->params as $rec) { + if ($rec = User::destroy($rec->id)) { array_push($destroyed, $rec); } } $res->success = true; $res->message = 'Destroyed ' . count($destroyed) . ' records'; } else { - if ($rec = User::destroy($this->params)) { + if ($rec = User::destroy($this->params->id)) { $res->message = "Destroyed User"; $res->success = true; } else {