ILIAS  release_8 Revision v8.24
StorageImpl.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use ilSetting;
24
30class StorageImpl implements Storage
31{
32 private const P_READING_TIME_STATUS = 'reading_time_status';
33
35
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}
__construct(ilSetting $globalSettings)
Definition: StorageImpl.php:36
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200