From 8389137f7cacbf2c21b2743569dfc112a8ed73c1 Mon Sep 17 00:00:00 2001 From: Arsen Mirzaev Tatyano-Muradovich Date: Sun, 11 Jan 2026 12:22:36 +0500 Subject: [PATCH] models `write()` returns `record` and commented useless account record update --- author/project/system/models/account.php | 4 ++-- author/project/system/models/authorizations.php | 6 +++--- author/project/system/models/settings.php | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/author/project/system/models/account.php b/author/project/system/models/account.php index c11794e..d38814e 100644 --- a/author/project/system/models/account.php +++ b/author/project/system/models/account.php @@ -228,11 +228,11 @@ final class account extends core implements record_interface $$settings->write(account: $$record->identifier); // Writing the record into the database - $$record = $$this->database->read( + /* $$record = $$this->database->read( filter: fn(record $$_record) => $$_record->identifier === $$record->identifier, update: fn(record &$$_record) => $$_record = $$record, amount: 1 - )[0] ?? null; + )[0] ?? null; */ // Exit (success) return $$record; diff --git a/author/project/system/models/authorizations.php b/author/project/system/models/authorizations.php index 514772c..d9b13a2 100644 --- a/author/project/system/models/authorizations.php +++ b/author/project/system/models/authorizations.php @@ -92,7 +92,7 @@ final class authorizations extends core implements record_interface * @param bool $$system_settings * @param bool $$active Is the record active? * - * @return int|false The record identifier, if created + * @return record|false The record identifier, if created */ public function write( int $$account, @@ -100,7 +100,7 @@ final class authorizations extends core implements record_interface bool $$settings = true, bool $$system_settings = false, bool $$active = true, - ): int|false + ): record|false { $$record = $$this->database->record( $$this->database->count() + 1, @@ -117,7 +117,7 @@ final class authorizations extends core implements record_interface $$created = $$this->database->write($$record); // Exit (success) - return $$created ? $$record->identifier : false; + return $$created ? $$record : false; } /** diff --git a/author/project/system/models/settings.php b/author/project/system/models/settings.php index 4a40d79..1e3fe66 100644 --- a/author/project/system/models/settings.php +++ b/author/project/system/models/settings.php @@ -83,12 +83,12 @@ final class settings extends core implements record_interface * @param int $$account The account identifier * @param int $$active Is the record active? * - * @return int|false The record identifier, if created + * @return record|false The record, if created */ public function write( int $$account, bool $$active = true, - ): int|false { + ): record|false { $$record = $$this->database->record( $$this->database->count() + 1, $$account, @@ -101,7 +101,7 @@ final class settings extends core implements record_interface $$created = $$this->database->write($$record); // Exit (success) - return $$created ? $$record->identifier : false; + return $$created ? $$record : false; } /**