summaryrefslogtreecommitdiff
path: root/includes/model/ShiftTypes_model.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-07-28 19:15:52 +0200
committermsquare <msquare@notrademark.de>2017-07-28 19:15:52 +0200
commita0af8d4624be9ca8579817d291036a6727aeb574 (patch)
tree869e7c39a3ec05aa6a4e478b51eb59bbf42746d1 /includes/model/ShiftTypes_model.php
parent5794c4cab8f6ef0529dfc51343b5ec78b134fb2a (diff)
further switching to db exceptions instead of return false
Diffstat (limited to 'includes/model/ShiftTypes_model.php')
-rw-r--r--includes/model/ShiftTypes_model.php15
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`');
}