ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
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)
 

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.

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

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

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

55  : ConditionDefinition
56  {
57  return $this->definition;
58  }
+ 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(), and ILIAS\Repository\ui().

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