From a157004f4aefaa5e2265f852f9432becedee1d66 Mon Sep 17 00:00:00 2001 From: msquare Date: Sun, 23 Jul 2017 11:46:54 +0200 Subject: handle failed db queries in Db class --- includes/model/ShiftTypes_model.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'includes/model/ShiftTypes_model.php') diff --git a/includes/model/ShiftTypes_model.php b/includes/model/ShiftTypes_model.php index 96a823d4..12fe38be 100644 --- a/includes/model/ShiftTypes_model.php +++ b/includes/model/ShiftTypes_model.php @@ -20,7 +20,6 @@ function ShiftType_delete($shifttype_id) * @param string $name * @param int $angeltype_id * @param string $description - * @return bool */ function ShiftType_update($shifttype_id, $name, $angeltype_id, $description) { @@ -38,8 +37,6 @@ function ShiftType_update($shifttype_id, $name, $angeltype_id, $description) $shifttype_id, ] ); - - return DB::getStm()->errorCode() == '00000'; } /** @@ -52,7 +49,7 @@ function ShiftType_update($shifttype_id, $name, $angeltype_id, $description) */ function ShiftType_create($name, $angeltype_id, $description) { - $result = DB::insert(' + DB::insert(' INSERT INTO `ShiftTypes` (`name`, `angeltype_id`, `description`) VALUES(?, ?, ?) ', @@ -63,10 +60,6 @@ function ShiftType_create($name, $angeltype_id, $description) ] ); - if ($result === false) { - return false; - } - return DB::getPdo()->lastInsertId(); } -- cgit v1.2.3-70-g09d2