ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTestPlaceholderValues Class Reference
+ Inheritance diagram for ilTestPlaceholderValues:
+ Collaboration diagram for ilTestPlaceholderValues:

Public Member Functions

 __construct (ilDefaultPlaceholderValues $defaultPlaceholderValues=null, ilLanguage $language=null, ilCertificateObjectHelper $objectHelper=null, ilCertificateTestObjectHelper $testObjectHelper=null, ilCertificateUserObjectHelper $userObjectHelper=null, ilCertificateLPStatusHelper $lpStatusHelper=null, ilCertificateUtilHelper $utilHelper=null, ilCertificateDateHelper $dateHelper=null)
 
 getPlaceholderValuesForPreview (int $userId, int $objId)
 This method is different then the 'getPlaceholderValues' method, this method is used to create a placeholder value array containing dummy values that is used to create a preview certificate. More...
 
- Public Member Functions inherited from ilCertificatePlaceholderValues
 getPlaceholderValues (int $userId, int $objId)
 This method MUST return an array that contains the actual data for the given user of the given object. More...
 

Private Attributes

 $defaultPlaceholderValuesObject
 
 $objectHelper
 
 $testObjectHelper
 
 $userObjectHelper
 
 $utilHelper
 
 $lpStatusHelper
 
 $dateHelper
 
 $language
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTestPlaceholderValues::__construct ( ilDefaultPlaceholderValues  $defaultPlaceholderValues = null,
ilLanguage  $language = null,
ilCertificateObjectHelper  $objectHelper = null,
ilCertificateTestObjectHelper  $testObjectHelper = null,
ilCertificateUserObjectHelper  $userObjectHelper = null,
ilCertificateLPStatusHelper  $lpStatusHelper = null,
ilCertificateUtilHelper  $utilHelper = null,
ilCertificateDateHelper  $dateHelper = null 
)
Parameters
ilDefaultPlaceholderValues$defaultPlaceholderValues
ilLanguage | null$language
ilCertificateObjectHelper | null$objectHelper
ilCertificateTestObjectHelper | null$testObjectHelper
ilCertificateUserObjectHelper | null$userObjectHelper
ilCertificateLPStatusHelper | null$lpStatusHelper
ilCertificateUtilHelper | null$utilHelper
ilDatePresentation | null$dateHelper

Definition at line 59 of file class.ilTestPlaceholderValues.php.

References $dateHelper, $DIC, $language, $lpStatusHelper, $objectHelper, $pass, $testObjectHelper, $userObjectHelper, $utilHelper, and ilCertificatePlaceholderValues\getPlaceholderValues().

68  {
69  if (null === $language) {
70  global $DIC;
71  $language = $DIC->language();
72  }
73  $this->language = $language;
74 
75  if (null === $defaultPlaceholderValues) {
76  $defaultPlaceholderValues = new ilDefaultPlaceholderValues();
77  }
78  $this->defaultPlaceholderValuesObject = $defaultPlaceholderValues;
79 
80  if (null === $objectHelper) {
81  $objectHelper = new ilCertificateObjectHelper();
82  }
83  $this->objectHelper = $objectHelper;
84 
85  if (null === $testObjectHelper) {
86  $testObjectHelper = new ilCertificateTestObjectHelper();
87  }
88  $this->testObjectHelper = $testObjectHelper;
89 
90  if (null === $userObjectHelper) {
91  $userObjectHelper = new ilCertificateUserObjectHelper();
92  }
93  $this->userObjectHelper = $userObjectHelper;
94 
95  if (null === $lpStatusHelper) {
96  $lpStatusHelper = new ilCertificateLPStatusHelper();
97  }
98  $this->lpStatusHelper = $lpStatusHelper;
99 
100  if (null === $utilHelper) {
101  $utilHelper = new ilCertificateUtilHelper();
102  }
103  $this->utilHelper = $utilHelper;
104 
105  if (null === $dateHelper) {
106  $dateHelper = new ilCertificateDateHelper();
107  }
108  $this->dateHelper = $dateHelper;
109  }
Collection of basic placeholder values that can be used.
global $DIC
Definition: saml.php:7
Just a wrapper class to create Unit Test for other classes.
+ Here is the call graph for this function:

Member Function Documentation

◆ getPlaceholderValuesForPreview()

ilTestPlaceholderValues::getPlaceholderValuesForPreview ( int  $userId,
int  $objId 
)

This method is different then the 'getPlaceholderValues' method, this method is used to create a placeholder value array containing dummy values that is used to create a preview certificate.

Parameters
int$userId
int$objId
Returns
array

Implements ilCertificatePlaceholderValues.

Definition at line 188 of file class.ilTestPlaceholderValues.php.

188  : array
189  {
190  $placeholders = $this->defaultPlaceholderValuesObject->getPlaceholderValuesForPreview($userId, $objId);
191 
192  $object = $this->objectHelper->getInstanceByObjId($objId);
193 
194  $placeholders['RESULT_PASSED'] = $this->utilHelper->prepareFormOutput($this->language->txt('certificate_var_result_passed'));
195  $placeholders['RESULT_POINTS'] = $this->utilHelper->prepareFormOutput($this->language->txt('certificate_var_result_points'));
196  $placeholders['RESULT_PERCENT'] = $this->utilHelper->prepareFormOutput($this->language->txt('certificate_var_result_percent'));
197  $placeholders['MAX_POINTS'] = $this->utilHelper->prepareFormOutput($this->language->txt('certificate_var_max_points'));
198  $placeholders['RESULT_MARK_SHORT'] = $this->utilHelper->prepareFormOutput($this->language->txt('certificate_var_result_mark_short'));
199  $placeholders['RESULT_MARK_LONG'] = $this->utilHelper->prepareFormOutput($this->language->txt('certificate_var_result_mark_long'));
200  $placeholders['TEST_TITLE'] = $this->utilHelper->prepareFormOutput($object->getTitle());
201 
202  return $placeholders;
203  }

Field Documentation

◆ $dateHelper

ilTestPlaceholderValues::$dateHelper
private

Definition at line 42 of file class.ilTestPlaceholderValues.php.

Referenced by __construct().

◆ $defaultPlaceholderValuesObject

ilTestPlaceholderValues::$defaultPlaceholderValuesObject
private

Definition at line 12 of file class.ilTestPlaceholderValues.php.

◆ $language

ilTestPlaceholderValues::$language
private

Definition at line 47 of file class.ilTestPlaceholderValues.php.

Referenced by __construct().

◆ $lpStatusHelper

ilTestPlaceholderValues::$lpStatusHelper
private

Definition at line 37 of file class.ilTestPlaceholderValues.php.

Referenced by __construct().

◆ $objectHelper

ilTestPlaceholderValues::$objectHelper
private

Definition at line 17 of file class.ilTestPlaceholderValues.php.

Referenced by __construct().

◆ $testObjectHelper

ilTestPlaceholderValues::$testObjectHelper
private

Definition at line 22 of file class.ilTestPlaceholderValues.php.

Referenced by __construct().

◆ $userObjectHelper

ilTestPlaceholderValues::$userObjectHelper
private

Definition at line 27 of file class.ilTestPlaceholderValues.php.

Referenced by __construct().

◆ $utilHelper

ilTestPlaceholderValues::$utilHelper
private

Definition at line 32 of file class.ilTestPlaceholderValues.php.

Referenced by __construct().


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