ILIAS  trunk Revision v11.0_alpha-2658-ge2404539063
ILIAS\TermsOfService\UserSettings Class Reference
+ Inheritance diagram for ILIAS\TermsOfService\UserSettings:
+ Collaboration diagram for ILIAS\TermsOfService\UserSettings:

Public Member Functions

 __construct (private readonly ilObjUser $user, private readonly SelectSetting $user_pref, private readonly Refinery $refinery)
 
 withdrawalRequested ()
 
 agreeDate ()
 

Private Member Functions

 setting (Convert $convert)
 
 convert ()
 

Detailed Description

Definition at line 32 of file UserSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\TermsOfService\UserSettings::__construct ( private readonly ilObjUser  $user,
private readonly SelectSetting  $user_pref,
private readonly Refinery  $refinery 
)

Definition at line 34 of file UserSettings.php.

38  {
39  }

Member Function Documentation

◆ agreeDate()

ILIAS\TermsOfService\UserSettings::agreeDate ( )
Returns
Setting<?DateTimeImmutable>

Implements ILIAS\LegalDocuments\ConsumerToolbox\UserSettings.

Definition at line 52 of file UserSettings.php.

References ILIAS\TermsOfService\UserSettings\convert(), and ILIAS\TermsOfService\UserSettings\setting().

52  : Setting
53  {
54  return $this->setting($this->convert());
55  }
+ Here is the call graph for this function:

◆ convert()

ILIAS\TermsOfService\UserSettings::convert ( )
private

Definition at line 68 of file UserSettings.php.

References Vendor\Package\$d, and ILIAS\Repository\refinery().

Referenced by ILIAS\TermsOfService\UserSettings\agreeDate().

68  : Convert
69  {
70  $custom = $this->refinery->custom()->transformation(...);
71  $null_or = fn($next) => $this->refinery->byTrying([$this->refinery->null(), $next]);
72 
73  return new Convert(
74  $null_or($this->refinery->to()->dateTime()),
75  $null_or($custom(fn(DateTimeImmutable $d): string => $d->format('Y-m-d H:i:s')))
76  );
77  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setting()

ILIAS\TermsOfService\UserSettings::setting ( Convert  $convert)
private

Definition at line 57 of file UserSettings.php.

References ILIAS\LegalDocuments\ConsumerToolbox\Convert\fromString(), ILIAS\LegalDocuments\ConsumerToolbox\Convert\toString(), and ILIAS\Repository\user().

Referenced by ILIAS\TermsOfService\UserSettings\agreeDate().

57  : Setting
58  {
59  return new Setting(
60  fn() => $convert->fromString()->transform($this->user->getAgreeDate()),
61  function ($value) use ($convert): void {
62  $this->user->setAgreeDate($convert->toString()->transform($value));
63  $this->user->update();
64  }
65  );
66  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withdrawalRequested()

ILIAS\TermsOfService\UserSettings::withdrawalRequested ( )
Returns
Setting<bool>

Implements ILIAS\LegalDocuments\ConsumerToolbox\UserSettings.

Definition at line 44 of file UserSettings.php.

References ILIAS\LegalDocuments\ConsumerToolbox\Marshal\boolean().

44  : Setting
45  {
46  return $this->user_pref->typed('consent_withdrawal_requested', fn(Marshal $m) => $m->boolean());
47  }
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: