From 5e4bf0bd228a47850ad0a68f53f9183d3d568197 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Thu, 28 Oct 2021 13:51:46 +0200 Subject: [PATCH] Corrected variable and table name --- application/models/Secretaries_model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/models/Secretaries_model.php b/application/models/Secretaries_model.php index 8eda32ea..67379bee 100644 --- a/application/models/Secretaries_model.php +++ b/application/models/Secretaries_model.php @@ -80,7 +80,7 @@ class Secretaries_model extends EA_Model { } // Validate secretary providers. - if (empty($provider['providers']) || ! is_array($provider['providers'])) + if (empty($secretary['providers']) || ! is_array($secretary['providers'])) { throw new InvalidArgumentException('The provided secretary providers are invalid: ' . print_r($secretary, TRUE)); } @@ -477,7 +477,7 @@ class Secretaries_model extends EA_Model { protected function save_provider_ids(int $secretary_id, array $provider_ids) { // Re-insert the secretary-provider connections. - $this->db->delete('secretary_providers', ['id_users_secretary' => $secretary_id]); + $this->db->delete('secretaries_providers', ['id_users_secretary' => $secretary_id]); foreach ($provider_ids as $provider_id) {