ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLSGlobalSettingsDB.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
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 }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
storeSettings(LSGlobalSettings $settings)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(\ilSetting $il_settings)