Unset foreach variable

This commit is contained in:
Alex Tselegidis 2024-04-26 16:40:33 +02:00
parent 86cd5f2285
commit 6576a9207d

View file

@ -619,8 +619,9 @@ class Calendar extends EA_Controller
$record_id = request('record_id'); $record_id = request('record_id');
$filter_type = request('filter_type'); $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([ json_response([
'appointments' => [], 'appointments' => [],
'unavailabilities' => [], 'unavailabilities' => [],
@ -674,6 +675,8 @@ class Calendar extends EA_Controller
$appointment['customer'] = $this->customers_model->find($appointment['id_users_customer']); $appointment['customer'] = $this->customers_model->find($appointment['id_users_customer']);
} }
unset($appointment);
// Get unavailability periods (only for provider). // Get unavailability periods (only for provider).
$response['unavailabilities'] = []; $response['unavailabilities'] = [];