2 Commits

Author SHA1 Message Date
b08051ccd3 commits merging 2025-12-24 22:20:24 +05:00
beccbfee1e namespace conflict fix 2025-12-24 22:15:06 +05:00
6 changed files with 10 additions and 13 deletions

0
.gitignore vendored Normal file → Executable file
View File

0
LICENSE Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
composer.json Normal file → Executable file
View File

6
mirzaev/record/system/interfaces/record.php Normal file → Executable file
View File

@@ -4,9 +4,6 @@ declare(strict_types=1);
namespace mirzaev\record\interfaces;
// Baza database
use mirzaev\baza\record as baza;
// Built-in libraries
use InvalidArgumentException as exception_invalid_argument;
@@ -19,7 +16,6 @@ use InvalidArgumentException as exception_invalid_argument;
*
* @package mirzaev\record\interfaces
*
* @method void __construct(record|null $record) Constructor
* @method static|false read(callable $filter) Read from the database
* @method static|false update() Update the record in the database
*
@@ -35,7 +31,7 @@ interface record
*
* @return void
*/
public function __construct(?baza $record = null);
public function __construct();
/**
* Read

17
mirzaev/record/system/traits/record.php Normal file → Executable file
View File

@@ -10,7 +10,8 @@ use svoboda\time\statement as svoboda;
// Baza database
use mirzaev\baza\database,
mirzaev\baza\column,
mirzaev\baza\record as baza,
mirzaev\baza\record as baza_record,
mirzaev\baza\enumerations\encoding,
mirzaev\baza\enumerations\type;
// Built-in libraries
@@ -43,9 +44,9 @@ trait record
/**
* Record
*
* @var baza $record The record instance
* @var baza_record $record The record instance
*/
protected baza $record;
protected baza_record $record;
/**
* Constructor
@@ -67,7 +68,7 @@ trait record
->connect($this->file); */
// Initializing the record
$record instanceof record and $this->record = $record;
$record instanceof baza_record and $this->record = $record;
}
/**
@@ -86,7 +87,7 @@ trait record
offset: 0
)[0] ?? false;
if ($record instanceof baza) {
if ($record instanceof baza_record) {
// Initialized the record
// Exit (success)
@@ -108,8 +109,8 @@ trait record
{
// Writing into the database
$record = $this->database->read(
filter: fn(baza $record) => $record->identifier === $this->record->identifier,
update: function (baza &$record) {
filter: fn(baza_record $record) => $record->identifier === $this->record->identifier,
update: function (baza_record &$record) {
$this->record->updated = svoboda::timestamp();
$record = $this->record;
},
@@ -117,7 +118,7 @@ trait record
offset: 0
)[0] ?? false;
if ($record instanceof record) {
if ($record instanceof baza_record) {
// Initialized the record
// Exit (success)