ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilTermsOfServiceCriterionTypeFactory Class Reference

Class ilTermsOfServiceCriterionTypeFactory. More...

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

Public Member Functions

 __construct (ilRbacReview $rbacReview, ilObjectDataCache $objectCache)
 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 
)

ilTermsOfServiceCriterionTypeFactory constructor.

Parameters
ilRbacReview$rbacReview
ilObjectDataCache$objectCache

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

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

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 40 of file class.ilTermsOfServiceCriterionTypeFactory.php.

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

41  {
42  if (isset($this->types[$typeIdent])) {
43  return $this->types[$typeIdent];
44  }
45 
46  if ($useFallback) {
47  return new ilTermsOfServiceNullCriterion();
48  }
49 
51  "Did not find criterion type by ident: %s",
52  var_export($typeIdent, true)
53  ));
54  }
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: