ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
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\DataProtection;
22 
29 
30 final 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('dpro_enabled', $this->boolean(...));
42  }
43 
47  public function validateOnLogin(): Setting
48  {
49  return $this->select->typed('dpro_validate_on_login', $this->boolean(...));
50  }
51 
55  public function deleteUserOnWithdrawal(): Setting
56  {
57  return $this->select->typed('dpro_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('dpro_last_reset_date', fn(Marshal $m) => $m->dateTime());
82  }
83 
87  public function noAcceptance(): Setting
88  {
89  return $this->select->typed('dpro_no_acceptance', $this->boolean(...));
90  }
91 
92  private function boolean(Marshal $m): Convert
93  {
94  return $m->boolean();
95  }
96 }
__construct(private readonly SelectSetting $select)
Definition: Settings.php:32