ILIAS  release_7 Revision v7.30-3-g800a261c036
ilTermsOfServiceCriterionTypeFactory Class Reference

Class ilTermsOfServiceCriterionTypeFactory. More...

+ Inheritance diagram for ilTermsOfServiceCriterionTypeFactory:
+ Collaboration diagram for ilTermsOfServiceCriterionTypeFactory:

Public Member Functions

 __construct (ilRbacReview $rbacReview, ilObjectDataCache $objectCache, array $countryCodes)
 ilTermsOfServiceCriterionTypeFactory constructor. More...
 
 getTypesByIdentMap ()
 
Returns
ilTermsOfServiceCriterionType[]
More...
 
 findByTypeIdent (string $typeIdent, bool $useFallback=false)
 
Parameters
string$typeIdent
bool$useFallback
Returns
ilTermsOfServiceCriterionType
Exceptions
ilTermsOfServiceCriterionTypeNotFoundException
More...
 

Protected Attributes

 $types = []
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTermsOfServiceCriterionTypeFactory::__construct ( ilRbacReview  $rbacReview,
ilObjectDataCache  $objectCache,
array  $countryCodes 
)

ilTermsOfServiceCriterionTypeFactory constructor.

Parameters
ilRbacReview$rbacReview
ilObjectDataCache$
string[]$countryCodes

Definition at line 19 of file class.ilTermsOfServiceCriterionTypeFactory.php.

20  {
21  $usrLanguageCriterion = new ilTermsOfServiceUserHasLanguageCriterion();
22  $usrGlobalRoleCriterion = new ilTermsOfServiceUserHasGlobalRoleCriterion($rbacReview, $objectCache);
23  $usrCountryCriterion = new ilTermsOfServiceUserHasCountryCriterion($countryCodes);
24 
25  $this->types = [
26  $usrLanguageCriterion->getTypeIdent() => $usrLanguageCriterion,
27  $usrGlobalRoleCriterion->getTypeIdent() => $usrGlobalRoleCriterion,
28  $usrCountryCriterion->getTypeIdent() => $usrCountryCriterion,
29  ];
30  }

Member Function Documentation

◆ findByTypeIdent()

ilTermsOfServiceCriterionTypeFactory::findByTypeIdent ( string  $typeIdent,
bool  $useFallback = false 
)

Parameters
string$typeIdent
bool$useFallback
Returns
ilTermsOfServiceCriterionType
Exceptions
ilTermsOfServiceCriterionTypeNotFoundException

Implements ilTermsOfServiceCriterionTypeFactoryInterface.

Definition at line 43 of file class.ilTermsOfServiceCriterionTypeFactory.php.

Referenced by ilTermsOfServiceCriterionTypeFactoryTest\testCriterionIsReturnedIfRequestedByTypeIdent(), ilTermsOfServiceCriterionTypeFactoryTest\testExceptionIsRaisedIfUnsupportedCriterionIsRequested(), and ilTermsOfServiceCriterionTypeFactoryTest\testNullCriterionIsReturnedAsFallbackIfUnsupportedCriterionIsRequested().

44  {
45  if (isset($this->types[$typeIdent])) {
46  return $this->types[$typeIdent];
47  }
48 
49  if ($useFallback) {
50  return new ilTermsOfServiceNullCriterion();
51  }
52 
54  "Did not find criterion type by ident: %s",
55  var_export($typeIdent, true)
56  ));
57  }
Interface ilTermsOfServiceCriterionType.
Class ilTermsOfServiceNullCriterion.
+ Here is the caller graph for this function:

◆ getTypesByIdentMap()

Field Documentation

◆ $types

ilTermsOfServiceCriterionTypeFactory::$types = []
protected

Definition at line 11 of file class.ilTermsOfServiceCriterionTypeFactory.php.

Referenced by getTypesByIdentMap().


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