ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
StorageImpl.php
Go to the documentation of this file.
1 <?php declare(strict_types=1);
2 /* Copyright (c) 1998-2020 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
5 
6 use ilSetting;
7 
13 class StorageImpl implements Storage
14 {
15  private const P_READING_TIME_STATUS = 'reading_time_status';
16 
18  private $globalSettings;
19 
25  {
26  $this->globalSettings = $globalSettings;
27  }
28 
32  public function getSettings() : Settings
33  {
34  $settings = new Settings();
35 
36  if ($this->globalSettings->get(self::P_READING_TIME_STATUS, false)) {
37  $settings = $settings->withEnabledReadingTime();
38  } else {
39  $settings = $settings->withDisabledReadingTime();
40  }
41 
42  return $settings;
43  }
44 
48  public function store(Settings $settings) : void
49  {
50  $this->globalSettings->set(self::P_READING_TIME_STATUS, ((string) (int) $settings->isReadingTimeEnabled()));
51  }
52 }
__construct(ilSetting $globalSettings)
StorageImpl constructor.
Definition: StorageImpl.php:24