ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Settings.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\TermsOfService;
22 
29 
30 class Settings implements SettingsInterface
31 {
32  public function __construct(private readonly SelectSetting $select)
33  {
34  }
35 
39  public function enabled(): Setting
40  {
41  return $this->select->typed('tos_status', $this->boolean(...));
42  }
43 
47  public function validateOnLogin(): Setting
48  {
49  return $this->select->typed('tos_reevaluate_on_login', $this->boolean(...));
50  }
51 
55  public function deleteUserOnWithdrawal(): Setting
56  {
57  return $this->select->typed('tos_withdrawal_usr_deletion', $this->boolean(...));
58  }
59 
63  public function adminEmail(): Setting
64  {
65  return $this->select->typed('admin_email', fn(Marshal $m) => $m->string());
66  }
67 
71  public function authMode(): Setting
72  {
73  return $this->select->typed('auth_mode', fn(Marshal $m) => $m->string());
74  }
75 
79  public function lastResetDate(): Setting
80  {
81  return $this->select->typed('tos_last_reset', fn(Marshal $m) => $m->dateTime());
82  }
83 
84  private function boolean(Marshal $m): Convert
85  {
86  return $m->boolean();
87  }
88 }
__construct(private readonly SelectSetting $select)
Definition: Settings.php:32