ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\LegalDocuments\Condition\UserLanguage Class Reference
+ Inheritance diagram for ILIAS\LegalDocuments\Condition\UserLanguage:
+ Collaboration diagram for ILIAS\LegalDocuments\Condition\UserLanguage:

Public Member Functions

 __construct (private readonly CriterionContent $criterion, private readonly UserLanguageDefinition $definition, private readonly UIFactory $create)
 
 asComponent ()
 
 eval (ilObjUser $user)
 
 definition ()
 
 knownToNeverMatchWith (Condition $other)
 

Detailed Description

Definition at line 31 of file UserLanguage.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LegalDocuments\Condition\UserLanguage::__construct ( private readonly CriterionContent  $criterion,
private readonly UserLanguageDefinition  $definition,
private readonly UIFactory  $create 
)

Definition at line 33 of file UserLanguage.php.

37  {
38  }

Member Function Documentation

◆ asComponent()

ILIAS\LegalDocuments\Condition\UserLanguage::asComponent ( )

Implements ILIAS\LegalDocuments\Condition.

Definition at line 40 of file UserLanguage.php.

References ILIAS\LegalDocuments\Condition\UserLanguage\definition().

40  : Component
41  {
42  return $this->create->legacy()->content(sprintf(
43  '<div><b>%s</b><br/>%s</div>',
44  $this->definition->translatedType(),
45  $this->definition->translatedLanguage($this->criterion->arguments()['lng'])
46  ));
47  }
+ Here is the call graph for this function:

◆ definition()

ILIAS\LegalDocuments\Condition\UserLanguage::definition ( )

Implements ILIAS\LegalDocuments\Condition.

Definition at line 54 of file UserLanguage.php.

Referenced by ILIAS\LegalDocuments\Condition\UserLanguage\asComponent().

54  : ConditionDefinition
55  {
56  return $this->definition;
57  }
+ Here is the caller graph for this function:

◆ eval()

ILIAS\LegalDocuments\Condition\UserLanguage::eval ( ilObjUser  $user)

Implements ILIAS\LegalDocuments\Condition.

Definition at line 49 of file UserLanguage.php.

References ilObjUser\getLanguage().

49  : bool
50  {
51  return strtoupper($user->getLanguage()) === strtoupper($this->criterion->arguments()['lng']);
52  }
+ Here is the call graph for this function:

◆ knownToNeverMatchWith()

ILIAS\LegalDocuments\Condition\UserLanguage::knownToNeverMatchWith ( Condition  $other)

Implements ILIAS\LegalDocuments\Condition.

Definition at line 59 of file UserLanguage.php.

59  : bool
60  {
61  return $other instanceof (self::class);
62  }

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