diff options
Diffstat (limited to 'includes/model/ShiftTypes_model.php')
-rw-r--r-- | includes/model/ShiftTypes_model.php | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/includes/model/ShiftTypes_model.php b/includes/model/ShiftTypes_model.php index d6efe117..05c1a949 100644 --- a/includes/model/ShiftTypes_model.php +++ b/includes/model/ShiftTypes_model.php @@ -71,27 +71,20 @@ function ShiftType_create($name, $angeltype_id, $description) function ShiftType($shifttype_id) { $shifttype = DB::select('SELECT * FROM `ShiftTypes` WHERE `id`=?', [$shifttype_id]); - if (DB::getStm()->errorCode() != '00000') { - engelsystem_error('Unable to load shift type.'); - } + if (empty($shifttype)) { return null; } + return array_shift($shifttype); } /** * Get all shift types. * - * @return array|false + * @return array */ function ShiftTypes() { - $result = DB::select('SELECT * FROM `ShiftTypes` ORDER BY `name`'); - - if (DB::getStm()->errorCode() != '00000') { - return false; - } - - return $result; + return DB::select('SELECT * FROM `ShiftTypes` ORDER BY `name`'); } |