ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi Class Reference
+ Inheritance diagram for ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi:
+ Collaboration diagram for ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi:

Public Member Functions

 __construct (private readonly bool $active, private readonly Closure $build_user)
 
 active ()
 Returns wether or not the corresponding consumer is active. More...
 
 agreed (ilObjUser $user)
 
 agreedToCurrentlyMatchingDocument (ilObjUser $user)
 
 everAgreed (ilObjUser $user)
 
 canAgree (ilObjUser $user)
 
 needsToAgree (ilObjUser $user)
 
 agreeDate (ilObjUser $user)
 

Private Member Functions

 user (ilObjUser $user)
 

Private Attributes

readonly WeakMap $cache
 

Detailed Description

Definition at line 30 of file PublicApi.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi::__construct ( private readonly bool  $active,
private readonly Closure  $build_user 
)

Definition at line 37 of file PublicApi.php.

38  {
39  $this->cache = new WeakMap();
40  }

Member Function Documentation

◆ active()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi::active ( )

Returns wether or not the corresponding consumer is active.

Please note that this doesn't influence the other methods.

Implements ILIAS\LegalDocuments\ConsumerSlots\PublicApi.

Definition at line 46 of file PublicApi.php.

46  : bool
47  {
48  return $this->active;
49  }

◆ agreed()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi::agreed ( ilObjUser  $user)

Implements ILIAS\LegalDocuments\ConsumerSlots\PublicApi.

Definition at line 51 of file PublicApi.php.

References ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi\everAgreed().

51  : bool
52  {
53  return $this->everAgreed($user);
54  }
+ Here is the call graph for this function:

◆ agreeDate()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi::agreeDate ( ilObjUser  $user)

Definition at line 77 of file PublicApi.php.

References ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi\user().

78  {
79  return $this->user($user)->agreeDate()->value();
80  }
+ Here is the call graph for this function:

◆ agreedToCurrentlyMatchingDocument()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi::agreedToCurrentlyMatchingDocument ( ilObjUser  $user)

Definition at line 56 of file PublicApi.php.

References ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi\user().

56  : bool
57  {
58  return !$this->user($user)->needsToAcceptNewDocument();
59  }
+ Here is the call graph for this function:

◆ canAgree()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi::canAgree ( ilObjUser  $user)

Definition at line 66 of file PublicApi.php.

References ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi\user().

Referenced by ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi\needsToAgree().

66  : bool
67  {
68  return !$this->user($user)->cannotAgree();
69  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ everAgreed()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi::everAgreed ( ilObjUser  $user)

Definition at line 61 of file PublicApi.php.

References ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi\user().

Referenced by ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi\agreed().

61  : bool
62  {
63  return !$this->user($user)->neverAgreed();
64  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ needsToAgree()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi::needsToAgree ( ilObjUser  $user)

Definition at line 71 of file PublicApi.php.

References ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi\canAgree(), and ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi\user().

71  : bool
72  {
73  return $this->canAgree($user)
74  && $this->user($user)->needsToAcceptNewDocument();
75  }
+ Here is the call graph for this function:

◆ user()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi::user ( ilObjUser  $user)
private

Definition at line 82 of file PublicApi.php.

Referenced by ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi\agreeDate(), ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi\agreedToCurrentlyMatchingDocument(), ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi\canAgree(), ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi\everAgreed(), and ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi\needsToAgree().

82  : User
83  {
84  if (!isset($this->cache[$user])) {
85  $this->cache[$user] = ($this->build_user)($user);
86  }
87 
88  return $this->cache[$user];
89  }
+ Here is the caller graph for this function:

Field Documentation

◆ $cache

readonly WeakMap ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\PublicApi::$cache
private

Definition at line 35 of file PublicApi.php.


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