ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilMDSettings.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
25 {
26  protected static ?self $instance = null;
27 
28  protected ilSetting $settings;
29  private bool $copyright_selection_active = false;
30 
31  private function __construct()
32  {
33  $this->read();
34  }
35 
36  public static function _getInstance(): ilMDSettings
37  {
38  if (self::$instance) {
39  return self::$instance;
40  }
41  return self::$instance = new ilMDSettings();
42  }
43 
44  public function isCopyrightSelectionActive(): bool
45  {
47  }
48 
49  public function activateCopyrightSelection(bool $a_status): void
50  {
51  $this->copyright_selection_active = $a_status;
52  }
53 
54  public function save(): void
55  {
56  $this->settings->set('copyright_selection_active', (string) $this->isCopyrightSelectionActive());
57  }
58 
59  private function read(): void
60  {
61  $this->settings = new ilSetting('md_settings');
62 
63  $this->copyright_selection_active = (bool) $this->settings->get('copyright_selection_active', '0');
64  }
65 }
bool $copyright_selection_active
activateCopyrightSelection(bool $a_status)
static self $instance