From 411f03fb4643cdf7afd9ef1a3fcc2142ad86f1bf Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Wed, 27 Jul 2016 17:28:46 +0200 Subject: Model: __set() cannot return a value, new exception instead --- include/clients-edit.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/clients-edit.php b/include/clients-edit.php index 00961aa..ded72d2 100644 --- a/include/clients-edit.php +++ b/include/clients-edit.php @@ -24,13 +24,8 @@ $response = new Response(); try { $client = new Client($_pdo, $_REQUEST['pk']); - if ($client->setName($_REQUEST['value'])) { - $response->success = true; - } else { - $response->http_response_code(500); - $response->success = false; - $response->message = "The client could not be edited due to an error."; - } + $client->name = $_REQUEST['value']; + $response->success = true; } catch (PDOException $e) { $response->http_response_code(500); $response->success = false; -- cgit v1.2.3