summaryrefslogtreecommitdiff
path: root/includes/model/Shifts_model.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-01-14 17:47:26 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2018-01-14 17:47:26 +0100
commitfe58e4f4220d6685b91bf516374e33936e1075e3 (patch)
tree6d2e3416a8148ef8070931c7a8bc1a50b7637bb2 /includes/model/Shifts_model.php
parent0e8cc2f0a73085170df45c6a40e8f3df06a6af51 (diff)
database: updated checks for selectOne
Diffstat (limited to 'includes/model/Shifts_model.php')
-rw-r--r--includes/model/Shifts_model.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php
index 62335882..5719a8e1 100644
--- a/includes/model/Shifts_model.php
+++ b/includes/model/Shifts_model.php
@@ -182,7 +182,7 @@ function NeededAngeltypes_by_ShiftsFilter(ShiftsFilter $shiftsFilter)
/**
* @param array $shift
* @param array $angeltype
- * @return array|null
+ * @return array
*/
function NeededAngeltype_by_Shift_and_Angeltype($shift, $angeltype)
{
@@ -323,7 +323,7 @@ function Shift_signup_allowed_angel(
return new ShiftSignupState(ShiftSignupState::NOT_ARRIVED, $free_entries);
}
- if ($user_shifts == null) {
+ if (empty($user_shifts)) {
$user_shifts = Shifts_by_user($user);
}
@@ -349,14 +349,14 @@ function Shift_signup_allowed_angel(
return new ShiftSignupState(ShiftSignupState::OCCUPIED, $free_entries);
}
- if ($user_angeltype == null) {
+ if (empty($user_angeltype)) {
$user_angeltype = UserAngelType_by_User_and_AngelType($user, $angeltype);
}
if (
- $user_angeltype == null
- || ($angeltype['no_self_signup'] == 1 && $user_angeltype != null)
- || ($angeltype['restricted'] == 1 && $user_angeltype != null && !isset($user_angeltype['confirm_user_id']))
+ empty($user_angeltype)
+ || ($angeltype['no_self_signup'] == 1 && !empty($user_angeltype))
+ || ($angeltype['restricted'] == 1 && !empty($user_angeltype) && !isset($user_angeltype['confirm_user_id']))
) {
// you cannot join if user is not of this angel type
// you cannot join if you are not confirmed