ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 UI $ui)
 
 asComponent ()
 
 eval (ilObjUser $user)
 
 definition ()
 
 knownToNeverMatchWith (Condition $other)
 
 asComponent ()
 
 eval (ilObjUser $user)
 
 knownToNeverMatchWith (Condition $other)
 
 definition ()
 

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 UI  $ui 
)

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.

40 : Component
41 {
42 return $this->ui->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 }

References ILIAS\LegalDocuments\Condition\UserLanguage\definition(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ definition()

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

Implements ILIAS\LegalDocuments\Condition.

Definition at line 55 of file UserLanguage.php.

55 : ConditionDefinition
56 {
57 return $this->definition;
58 }

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

+ 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.

49 : bool
50 {
51 $user_lang = $user->getLanguage() ?: $this->ui->getDefaultLanguage();
52 return strtoupper($user_lang) === strtoupper($this->criterion->arguments()['lng']);
53 }

References ilObjUser\getLanguage(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ knownToNeverMatchWith()

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

Implements ILIAS\LegalDocuments\Condition.

Definition at line 60 of file UserLanguage.php.

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

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