From 182cebfb747de84df3dbf692e6997da702aa34c6 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Fri, 29 Oct 2021 13:12:39 +0200 Subject: [PATCH] Renamed the add_unavailable method to save_unavailable for consistency --- application/controllers/Backend_api.php | 4 ++-- application/controllers/api/v1/Unavailabilities.php | 4 ++-- application/models/Appointments_model.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/application/controllers/Backend_api.php b/application/controllers/Backend_api.php index 2ab0f963..2cb69bc9 100755 --- a/application/controllers/Backend_api.php +++ b/application/controllers/Backend_api.php @@ -496,7 +496,7 @@ class Backend_api extends EA_Controller { $provider = $this->providers_model->find($unavailable['id_users_provider']); // Add appointment - $unavailable['id'] = $this->appointments_model->add_unavailable($unavailable); + $unavailable['id'] = $this->appointments_model->save_unavailable($unavailable); $unavailable = $this->appointments_model->find($unavailable['id']); // fetch all inserted data // Google Sync @@ -514,7 +514,7 @@ class Backend_api extends EA_Controller { { $google_event = $this->google_sync->add_unavailable($provider, $unavailable); $unavailable['id_google_calendar'] = $google_event->id; - $this->appointments_model->add_unavailable($unavailable); + $this->appointments_model->save_unavailable($unavailable); } else { diff --git a/application/controllers/api/v1/Unavailabilities.php b/application/controllers/api/v1/Unavailabilities.php index b5c01c25..f4eefe5c 100644 --- a/application/controllers/api/v1/Unavailabilities.php +++ b/application/controllers/api/v1/Unavailabilities.php @@ -92,7 +92,7 @@ class Unavailabilities extends API_V1_Controller { unset($unavailability['id']); } - $id = $this->appointments_model->add_unavailable($unavailability); + $id = $this->appointments_model->save_unavailable($unavailability); // Fetch the new object from the database and return it to the client. $batch = $this->appointments_model->get(['id' => $id]); @@ -128,7 +128,7 @@ class Unavailabilities extends API_V1_Controller { $baseUnavailability = $batch[0]; $this->parser->decode($updatedUnavailability, $baseUnavailability); $updatedUnavailability['id'] = $id; - $id = $this->appointments_model->add_unavailable($updatedUnavailability); + $id = $this->appointments_model->save_unavailable($updatedUnavailability); // Fetch the updated object from the database and return it to the client. $batch = $this->appointments_model->get(['id' => $id]); diff --git a/application/models/Appointments_model.php b/application/models/Appointments_model.php index bd40bfc1..1503c64e 100644 --- a/application/models/Appointments_model.php +++ b/application/models/Appointments_model.php @@ -311,7 +311,7 @@ class Appointments_model extends EA_Model { * * @throws InvalidArgumentException */ - public function add_unavailable(array $unavailable): int + public function save_unavailable(array $unavailable): int { // Make sure the start date time is before the end date time. $start = strtotime($unavailable['start_datetime']);