ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilLSGlobalSettingsDB.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
25 {
26  public const SETTING_POLL_INTERVAL = 'lso_polling_interval';
27  public const POLL_INTERVAL_DEFAULT = 10; //in seconds
28 
30 
31  public function __construct(\ilSetting $il_settings)
32  {
33  $this->il_settings = $il_settings;
34  }
35 
36  public function getSettings(): LSGlobalSettings
37  {
38  $interval_seconds = (float) $this->il_settings->get(
39  self::SETTING_POLL_INTERVAL,
40  (string) self::POLL_INTERVAL_DEFAULT
41  );
42 
43  return new LSGlobalSettings($interval_seconds);
44  }
45 
46  public function storeSettings(LSGlobalSettings $settings): void
47  {
48  $this->il_settings->set(
49  self::SETTING_POLL_INTERVAL,
50  (string) $settings->getPollingIntervalSeconds()
51  );
52  }
53 }
storeSettings(LSGlobalSettings $settings)
Global Settings of the Learning Sequence.
Repository for LSGlobalSettings over ILIAS global settings.
Repository for LSGlobalSettings.
__construct(\ilSetting $il_settings)