forked from mirzaev/pot-php
fixed by garden/campanula
This commit is contained in:
@@ -71,9 +71,9 @@ final class authorizations extends core implements record_interface
|
||||
new column('account', type::long_long_unsigned),
|
||||
new column('system', type::char),
|
||||
new column('settings', type::char),
|
||||
new column('chat', type::char),
|
||||
/* new column('', type::char), */
|
||||
new column('system_settings', type::char),
|
||||
new column('active', type::char),
|
||||
new column('updated', type::integer_unsigned),
|
||||
new column('created', type::integer_unsigned)
|
||||
)
|
||||
@@ -87,25 +87,28 @@ final class authorizations extends core implements record_interface
|
||||
* Write
|
||||
*
|
||||
* @param int $$account The account identifier
|
||||
* @param int $$system
|
||||
* @param int $$settings
|
||||
* @param int $$system_settings
|
||||
* @param bool $$system
|
||||
* @param bool $$settings
|
||||
* @param bool $$system_settings
|
||||
* @param bool $$active Is the record active?
|
||||
*
|
||||
* @return int|false The record identifier, if created
|
||||
*/
|
||||
public function write(
|
||||
int $$account,
|
||||
int $$system = 1,
|
||||
int $$settings = 1,
|
||||
int $$system_settings = 0,
|
||||
bool $$system = true,
|
||||
bool $$settings = true,
|
||||
bool $$system_settings = false,
|
||||
bool $$active = true,
|
||||
): int|false
|
||||
{
|
||||
$$record = $$this->database->record(
|
||||
$$this->database->count() + 1,
|
||||
$$account,
|
||||
$$system,
|
||||
$$settings,
|
||||
$$system_settings,
|
||||
(int) $$system,
|
||||
(int) $$settings,
|
||||
(int) $$system_settings,
|
||||
(int) $$active,
|
||||
svoboda::timestamp(),
|
||||
svoboda::timestamp()
|
||||
);
|
||||
@@ -116,5 +119,39 @@ final class authorizations extends core implements record_interface
|
||||
// Exit (success)
|
||||
return $$created ? $$record->identifier : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize
|
||||
*
|
||||
* @return self The instance from which the method was called (fluent interface)
|
||||
*/
|
||||
public function serialize(): self
|
||||
{
|
||||
// Serializing the record parameters
|
||||
$$this->record->system = (int) $$this->record->system;
|
||||
$$this->record->settings = (int) $$this->record->settings;
|
||||
$$this->record->system_settings = (int) $$this->record->system_settings;
|
||||
$$this->record->active = (int) $$this->record->active;
|
||||
|
||||
// Exit (success)
|
||||
return $$this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserialize
|
||||
*
|
||||
* @return self The instance from which the method was called (fluent interface)
|
||||
*/
|
||||
public function deserialize(): self
|
||||
{
|
||||
// Deserializing the record parameters
|
||||
$$this->record->system = (bool) $$this->record->system;
|
||||
$$this->record->settings = (bool) $$this->record->settings;
|
||||
$$this->record->system_settings = (bool) $$this->record->system_settings;
|
||||
$$this->record->active = (bool) $$this->record->active;
|
||||
|
||||
// Exit (success)
|
||||
return $$this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user