ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilTermsOfServiceUserHasLanguageCriterion.php
Go to the documentation of this file.
1<?php declare(strict_types=1);
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
9{
13 public function getTypeIdent() : string
14 {
15 return 'usr_language';
16 }
17
21 public function hasUniqueNature() : bool
22 {
23 return true;
24 }
25
30 {
31 $lng = $config['lng'] ?? '';
32
33 if (!is_string($lng) || 2 !== strlen($lng)) {
34 return false;
35 }
36
37 $result = strtolower($lng) === strtolower($user->getLanguage());
38
39 return $result;
40 }
41
46 {
48 }
49}
$result
An exception for terminatinating execution or to throw for unit testing.
language handling
getLanguage()
returns a 2char-language-string @access public
Class ilTermsOfServiceCriterionConfig.
hasUniqueNature()
Returns whether or not a criterion is unique by it's nature.Example: "User Language"....
evaluate(ilObjUser $user, ilTermsOfServiceCriterionConfig $config)
bool
getTypeIdent()
Returns a unique id of the criterion type.string
Interface ilTermsOfServiceCriterionTypeGUI.
Interface ilTermsOfServiceCriterionType.
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
$lng