models write() returns record and commented useless account record update
This commit is contained in:
@@ -228,11 +228,11 @@ final class account extends core implements record_interface
|
|||||||
$$settings->write(account: $$record->identifier);
|
$$settings->write(account: $$record->identifier);
|
||||||
|
|
||||||
// Writing the record into the database
|
// Writing the record into the database
|
||||||
$$record = $$this->database->read(
|
/* $$record = $$this->database->read(
|
||||||
filter: fn(record $$_record) => $$_record->identifier === $$record->identifier,
|
filter: fn(record $$_record) => $$_record->identifier === $$record->identifier,
|
||||||
update: fn(record &$$_record) => $$_record = $$record,
|
update: fn(record &$$_record) => $$_record = $$record,
|
||||||
amount: 1
|
amount: 1
|
||||||
)[0] ?? null;
|
)[0] ?? null; */
|
||||||
|
|
||||||
// Exit (success)
|
// Exit (success)
|
||||||
return $$record;
|
return $$record;
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ final class authorizations extends core implements record_interface
|
|||||||
* @param bool $$system_settings
|
* @param bool $$system_settings
|
||||||
* @param bool $$active Is the record active?
|
* @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(
|
public function write(
|
||||||
int $$account,
|
int $$account,
|
||||||
@@ -100,7 +100,7 @@ final class authorizations extends core implements record_interface
|
|||||||
bool $$settings = true,
|
bool $$settings = true,
|
||||||
bool $$system_settings = false,
|
bool $$system_settings = false,
|
||||||
bool $$active = true,
|
bool $$active = true,
|
||||||
): int|false
|
): record|false
|
||||||
{
|
{
|
||||||
$$record = $$this->database->record(
|
$$record = $$this->database->record(
|
||||||
$$this->database->count() + 1,
|
$$this->database->count() + 1,
|
||||||
@@ -117,7 +117,7 @@ final class authorizations extends core implements record_interface
|
|||||||
$$created = $$this->database->write($$record);
|
$$created = $$this->database->write($$record);
|
||||||
|
|
||||||
// Exit (success)
|
// Exit (success)
|
||||||
return $$created ? $$record->identifier : false;
|
return $$created ? $$record : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -83,12 +83,12 @@ final class settings extends core implements record_interface
|
|||||||
* @param int $$account The account identifier
|
* @param int $$account The account identifier
|
||||||
* @param int $$active Is the record active?
|
* @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(
|
public function write(
|
||||||
int $$account,
|
int $$account,
|
||||||
bool $$active = true,
|
bool $$active = true,
|
||||||
): int|false {
|
): record|false {
|
||||||
$$record = $$this->database->record(
|
$$record = $$this->database->record(
|
||||||
$$this->database->count() + 1,
|
$$this->database->count() + 1,
|
||||||
$$account,
|
$$account,
|
||||||
@@ -101,7 +101,7 @@ final class settings extends core implements record_interface
|
|||||||
$$created = $$this->database->write($$record);
|
$$created = $$this->database->write($$record);
|
||||||
|
|
||||||
// Exit (success)
|
// Exit (success)
|
||||||
return $$created ? $$record->identifier : false;
|
return $$created ? $$record : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user