|
| __construct (ilObjectCustomUserFieldsPlaceholderValues $customUserFieldsPlaceholderValues=null, ilDefaultPlaceholderValues $defaultPlaceholderValues=null, ilLanguage $language=null, ilCertificateObjectHelper $objectHelper=null, ilCertificateParticipantsHelper $participantsHelper=null, ilCertificateUtilHelper $ilUtilHelper=null, ilCertificateDateHelper $dateHelper=null, ilCertificateLPStatusHelper $lpStatusHelper=null) |
|
| 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...
|
|
| 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...
|
|
◆ __construct()
- Parameters
-
Definition at line 59 of file class.ilCoursePlaceholderValues.php.
References $dateHelper, $DIC, $ilUtilHelper, $language, $lpStatusHelper, $objectHelper, $participantsHelper, and language().
69 if (null === $language) {
71 $language = $DIC->language();
76 if (null === $defaultPlaceholderValues) {
80 if (null === $customUserFieldsPlaceholderValues) {
84 if (null === $objectHelper) {
89 if (null === $participantsHelper) {
94 if (null === $ilUtilHelper) {
99 if (null === $dateHelper) {
104 if (null === $lpStatusHelper) {
109 $this->customUserFieldsPlaceholderValuesObject = $customUserFieldsPlaceholderValues;
110 $this->defaultPlaceholderValuesObject = $defaultPlaceholderValues;
Collection of basic placeholder values that can be used.
Just a wrapper class to create Unit Test for other classes.
loadLanguageModule($a_module)
◆ getPlaceholderValues()
ilCoursePlaceholderValues::getPlaceholderValues |
( |
int |
$userId, |
|
|
int |
$objId |
|
) |
| |
This method MUST return an array that contains the actual data for the given user of the given object.
ilInvalidCertificateException MUST be thrown if the data could not be determined or the user did NOT achieve the certificate.
- Parameters
-
- Returns
- array - [PLACEHOLDER] => 'actual value'
- Exceptions
-
Implements ilCertificatePlaceholderValues.
Definition at line 137 of file class.ilCoursePlaceholderValues.php.
References hasCompletionDate().
139 $courseObject = $this->objectHelper->getInstanceByObjId(
$objId);
141 $placeholders = $this->defaultPlaceholderValuesObject->getPlaceholderValues($userId,
$objId);
143 $customUserFieldsPlaceholders = $this->customUserFieldsPlaceholderValuesObject->getPlaceholderValues($userId,
$objId);
145 $placeholders = array_merge($placeholders, $customUserFieldsPlaceholders);
147 $completionDate = $this->participantsHelper->getDateTimeOfPassed(
$objId, $userId);
149 $completionDate = $this->lpStatusHelper->lookupStatusChanged(
$objId, $userId);
153 $placeholders[
'DATE_COMPLETED'] = $this->dateHelper->formatDate($completionDate);
154 $placeholders[
'DATETIME_COMPLETED'] = $this->dateHelper->formatDateTime($completionDate);
157 $placeholders[
'COURSE_TITLE'] = $this->ilUtilHelper->prepareFormOutput($courseObject->getTitle());
159 return $placeholders;
hasCompletionDate($possibleDate)
◆ getPlaceholderValuesForPreview()
ilCoursePlaceholderValues::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
-
- Returns
- array
Implements ilCertificatePlaceholderValues.
Definition at line 170 of file class.ilCoursePlaceholderValues.php.
References ilUtil\prepareFormOutput().
172 $placeholders = $this->defaultPlaceholderValuesObject->getPlaceholderValuesForPreview($userId,
$objId);
174 $customUserFieldsPlaceholders = $this->customUserFieldsPlaceholderValuesObject->getPlaceholderValuesForPreview($userId,
$objId);
176 $placeholders = array_merge($placeholders, $customUserFieldsPlaceholders);
178 $object = $this->objectHelper->getInstanceByObjId(
$objId);
182 return $placeholders;
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
◆ hasCompletionDate()
ilCoursePlaceholderValues::hasCompletionDate |
( |
|
$possibleDate | ) |
|
|
private |
◆ $customUserFieldsPlaceholderValuesObject
ilCoursePlaceholderValues::$customUserFieldsPlaceholderValuesObject |
|
private |
◆ $dateHelper
ilCoursePlaceholderValues::$dateHelper |
|
private |
◆ $defaultPlaceholderValuesObject
ilCoursePlaceholderValues::$defaultPlaceholderValuesObject |
|
private |
◆ $ilUtilHelper
ilCoursePlaceholderValues::$ilUtilHelper |
|
private |
◆ $language
ilCoursePlaceholderValues::$language |
|
private |
◆ $lpStatusHelper
ilCoursePlaceholderValues::$lpStatusHelper |
|
private |
◆ $objectHelper
ilCoursePlaceholderValues::$objectHelper |
|
private |
◆ $participantsHelper
ilCoursePlaceholderValues::$participantsHelper |
|
private |
The documentation for this class was generated from the following file: