From 3c5be0d12b3a803c88d3b6f1a924e8243ab61d0e Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Fri, 5 Nov 2021 08:28:59 +0100 Subject: [PATCH] The set setting method could also get a NULL value --- application/models/Admins_model.php | 4 ++-- application/models/Providers_model.php | 4 ++-- application/models/Secretaries_model.php | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/application/models/Admins_model.php b/application/models/Admins_model.php index 3899d66b..b2a115b8 100644 --- a/application/models/Admins_model.php +++ b/application/models/Admins_model.php @@ -438,9 +438,9 @@ class Admins_model extends EA_Model { * * @param int $admin_id Admin ID. * @param string $name Setting name. - * @param string $value Setting value. + * @param string|null $value Setting value. */ - public function set_setting(int $admin_id, string $name, string $value) + public function set_setting(int $admin_id, string $name, string $value = NULL) { if ( ! $this->db->update('user_settings', [$name => $value], ['id_users' => $admin_id])) { diff --git a/application/models/Providers_model.php b/application/models/Providers_model.php index 7f045743..3998a9d9 100755 --- a/application/models/Providers_model.php +++ b/application/models/Providers_model.php @@ -464,9 +464,9 @@ class Providers_model extends EA_Model { * * @param int $provider_id Provider ID. * @param string $name Setting name. - * @param string $value Setting value. + * @param string|null $value Setting value. */ - public function set_setting(int $provider_id, string $name, string $value) + public function set_setting(int $provider_id, string $name, string $value = NULL) { if ( ! $this->db->update('user_settings', [$name => $value], ['id_users' => $provider_id])) { diff --git a/application/models/Secretaries_model.php b/application/models/Secretaries_model.php index 97513882..b0ee26e5 100644 --- a/application/models/Secretaries_model.php +++ b/application/models/Secretaries_model.php @@ -280,7 +280,7 @@ class Secretaries_model extends EA_Model { { if ( ! $this->db->get_where('users', ['id' => $secretary_id])->num_rows()) { - throw new InvalidArgumentException('The provided secretary ID was not found in the database: ' . $provider_id); + throw new InvalidArgumentException('The provided secretary ID was not found in the database: ' . $secretary_id); } $secretary = $this->db->get_where('users', ['id' => $secretary_id])->row_array(); @@ -332,7 +332,7 @@ class Secretaries_model extends EA_Model { if ( ! $query->num_rows()) { - throw new InvalidArgumentException('The provided secretary ID was not found in the database: ' . $provider_id); + throw new InvalidArgumentException('The provided secretary ID was not found in the database: ' . $secretary_id); } // Check if the required field is part of the secretary data. @@ -446,9 +446,9 @@ class Secretaries_model extends EA_Model { * * @param int $secretary_id Secretary ID. * @param string $name Setting name. - * @param string $value Setting value. + * @param string|null $value Setting value. */ - public function set_setting(int $secretary_id, string $name, string $value) + public function set_setting(int $secretary_id, string $name, string $value = NULL) { if ( ! $this->db->update('user_settings', [$name => $value], ['id_users' => $secretary_id])) {