ILIAS  release_8 Revision v8.23
StorageImpl.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 use ilSetting;
24 
30 class StorageImpl implements Storage
31 {
32  private const P_READING_TIME_STATUS = 'reading_time_status';
33 
35 
36  public function __construct(ilSetting $globalSettings)
37  {
38  $this->globalSettings = $globalSettings;
39  }
40 
41  public function getSettings(): Settings
42  {
43  $settings = new Settings();
44 
45  if ($this->globalSettings->get(self::P_READING_TIME_STATUS, '0')) {
46  $settings = $settings->withEnabledReadingTime();
47  } else {
48  $settings = $settings->withDisabledReadingTime();
49  }
50 
51  return $settings;
52  }
53 
54  public function store(Settings $settings): void
55  {
56  $this->globalSettings->set(self::P_READING_TIME_STATUS, ((string) (int) $settings->isReadingTimeEnabled()));
57  }
58 }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
__construct(ilSetting $globalSettings)
Definition: StorageImpl.php:36