From 1975fb8ebede1f723e3f9c89a0a289f92a0eb33c Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 20 Jan 2026 22:26:08 +0100 Subject: [PATCH] OTS_Account: setCustomField - Use Account model to update --- system/libs/pot/OTS_Account.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/system/libs/pot/OTS_Account.php b/system/libs/pot/OTS_Account.php index 6ad211df..2ce3b095 100644 --- a/system/libs/pot/OTS_Account.php +++ b/system/libs/pot/OTS_Account.php @@ -12,6 +12,7 @@ * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU Lesser General Public License, Version 3 */ +use MyAAC\Models\Account as AccountModel; use MyAAC\Models\AccountAction; /** @@ -702,17 +703,11 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable */ public function setCustomField($field, $value) { - if( !isset($this->data['id']) ) - { + if( !isset($this->data['id']) ) { throw new E_OTS_NotLoaded(); } - // quotes value for SQL query - if(!( is_int($value) || is_float($value) )) - { - $value = $this->db->quote($value); - } - $this->db->exec('UPDATE ' . $this->db->tableName('accounts') . ' SET ' . $this->db->fieldName($field) . ' = ' . $value . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']); + AccountModel::where('id', $this->data['id'])->update([$field => $value]); } /**