From 6576a9207d777bf5dc0399a5d8b5089f5754de6f Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Fri, 26 Apr 2024 16:40:33 +0200 Subject: [PATCH] Unset foreach variable --- application/controllers/Calendar.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/controllers/Calendar.php b/application/controllers/Calendar.php index 1e201f0f..2efaa8f9 100644 --- a/application/controllers/Calendar.php +++ b/application/controllers/Calendar.php @@ -619,8 +619,9 @@ class Calendar extends EA_Controller $record_id = request('record_id'); $filter_type = request('filter_type'); + $is_all = request('record_id') === FILTER_TYPE_ALL; - if (!$filter_type && $record_id !== FILTER_TYPE_ALL) { + if (!$filter_type && !$is_all) { json_response([ 'appointments' => [], 'unavailabilities' => [], @@ -674,6 +675,8 @@ class Calendar extends EA_Controller $appointment['customer'] = $this->customers_model->find($appointment['id_users_customer']); } + unset($appointment); + // Get unavailability periods (only for provider). $response['unavailabilities'] = [];