From b1ee745aacc02bc6407c712d32d304b08c2a101e Mon Sep 17 00:00:00 2001 From: Arsen Mirzaev Tatyano-Muradovich Date: Mon, 3 Nov 2025 16:59:44 +0300 Subject: [PATCH] small fixes --- mirzaev/record/system/interfaces/record.php | 17 ++--------------- mirzaev/record/system/traits/record.php | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/mirzaev/record/system/interfaces/record.php b/mirzaev/record/system/interfaces/record.php index 29daff4..1ba79ba 100644 --- a/mirzaev/record/system/interfaces/record.php +++ b/mirzaev/record/system/interfaces/record.php @@ -4,21 +4,8 @@ declare(strict_types=1); namespace mirzaev\record\interfaces; -// Svoboda time -use svoboda\time\statement as svoboda; - -// Baza database -use mirzaev\baza\database, - mirzaev\baza\column, - mirzaev\baza\record, - mirzaev\baza\enumerations\encoding, - mirzaev\baza\enumerations\type; - // Built-in libraries -use Exception as exception, - RuntimeException as exception_runtime, - LogicException as exception_logic, - InvalidArgumentException as exception_invalid_argument; +use InvalidArgumentException as exception_invalid_argument; /** * Active Record @@ -35,7 +22,7 @@ use Exception as exception, * @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License * @author Arsen Mirzaev Tatyano-Muradovich */ -interface ar +interface record { /** * Constructor diff --git a/mirzaev/record/system/traits/record.php b/mirzaev/record/system/traits/record.php index f8ead01..b9f5355 100644 --- a/mirzaev/record/system/traits/record.php +++ b/mirzaev/record/system/traits/record.php @@ -10,7 +10,7 @@ use svoboda\time\statement as svoboda; // Baza database use mirzaev\baza\database, mirzaev\baza\column, - mirzaev\baza\record, + mirzaev\baza\record as baza, mirzaev\baza\enumerations\encoding, mirzaev\baza\enumerations\type; @@ -41,6 +41,13 @@ use Exception as exception, */ trait record { + /** + * Record + * + * @var baza $record The record instance + */ + protected baza $record; + /** * Read * @@ -57,7 +64,7 @@ trait record offset: 0 )[0] ?? false; - if ($record instanceof record) { + if ($record instanceof baza) { // Initialized the record // Exit (success) @@ -79,9 +86,9 @@ trait record { // Writing into the database $record = $this->database->read( - filter: fn(record $record) => $record->identifier === $this->record->identifier, - update: function (record &$record) { - $this->record->updated = mirzaev::timestamp(); + filter: fn(baza $record) => $record->identifier === $this->record->identifier, + update: function (baza &$record) { + $this->record->updated = svoboda::timestamp(); $record = $this->record; }, amount: 1,