1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-12-12 17:27:43 +01:00
MadelineProto/src/Settings/Serialization.php

45 lines
944 B
PHP
Raw Normal View History

2022-12-30 21:54:44 +01:00
<?php
declare(strict_types=1);
namespace danog\MadelineProto\Settings;
use danog\MadelineProto\SettingsAbstract;
/**
* Serialization settings.
*/
2023-01-15 12:05:38 +01:00
final class Serialization extends SettingsAbstract
{
/**
* Serialization interval, in seconds.
*/
protected int $interval = 30;
public function mergeArray(array $settings): void
{
if (isset($settings['serialization']['serialization_interval'])) {
$this->setInterval($settings['serialization']['serialization_interval']);
}
}
/**
* Get serialization interval, in seconds.
*/
public function getInterval(): int
{
return $this->interval;
}
/**
* Set serialization interval, in seconds.
*
* @param int $interval Serialization interval, in seconds.
*/
public function setInterval(int $interval): self
{
$this->interval = $interval;
return $this;
}
}