summaryrefslogtreecommitdiff
path: root/includes/model/ShiftEntry_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/ShiftEntry_model.php
parent5794c4cab8f6ef0529dfc51343b5ec78b134fb2a (diff)
further switching to db exceptions instead of return false
Diffstat (limited to 'includes/model/ShiftEntry_model.php')
-rw-r--r--includes/model/ShiftEntry_model.php13
1 files changed, 4 insertions, 9 deletions
diff --git a/includes/model/ShiftEntry_model.php b/includes/model/ShiftEntry_model.php
index bca63774..563a611f 100644
--- a/includes/model/ShiftEntry_model.php
+++ b/includes/model/ShiftEntry_model.php
@@ -125,17 +125,16 @@ function ShiftEntry_update($shift_entry)
* Get a shift entry.
*
* @param int $shift_entry_id
- * @return array|false|null
+ * @return array|null
*/
function ShiftEntry($shift_entry_id)
{
$shift_entry = DB::select('SELECT * FROM `ShiftEntry` WHERE `id` = ?', [$shift_entry_id]);
- if (DB::getStm()->errorCode() != '00000') {
- return false;
- }
+
if (empty($shift_entry)) {
return null;
}
+
return $shift_entry[0];
}
@@ -209,7 +208,7 @@ function ShiftEntries_finished_by_user($user)
*/
function ShiftEntries_by_shift_and_angeltype($shift_id, $angeltype_id)
{
- $result = DB::select('
+ return DB::select('
SELECT *
FROM `ShiftEntry`
WHERE `SID` = ?
@@ -220,10 +219,6 @@ function ShiftEntries_by_shift_and_angeltype($shift_id, $angeltype_id)
$angeltype_id,
]
);
- if (DB::getStm()->errorCode() != '00000') {
- engelsystem_error('Unable to load shift entries.');
- }
- return $result;
}
/**