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...
 
 getTypesByIdentMap ()
 
 findByTypeIdent (string $typeIdent, bool $useFallback=false)
 

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.

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

Referenced by ilTermsOfServiceCriterionTypeFactoryTest\testCriterionIsReturnedIfRequestedByTypeIdent().

+ Here is the caller graph for this function:

◆ getTypesByIdentMap()

ilTermsOfServiceCriterionTypeFactory::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: