19 declare(strict_types=1);
45 if (null === $language) {
47 $language = $DIC->language();
52 if (null === $defaultPlaceholderValues) {
56 if (null === $customUserFieldsPlaceholderValues) {
60 if (null === $objectHelper) {
65 if (null === $participantsHelper) {
70 if (null === $ilUtilHelper) {
75 if (null === $dateHelper) {
80 if (null === $lpStatusHelper) {
85 $this->customUserFieldsPlaceholderValuesObject = $customUserFieldsPlaceholderValues;
86 $this->defaultPlaceholderValuesObject = $defaultPlaceholderValues;
96 $possibleDate !==
false &&
97 $possibleDate !== null &&
119 $courseObject = $this->objectHelper->getInstanceByObjId($objId);
121 $placeholders = $this->defaultPlaceholderValuesObject->getPlaceholderValues($userId, $objId);
123 $customUserFieldsPlaceholders = $this->customUserFieldsPlaceholderValuesObject->getPlaceholderValues(
128 $placeholders = array_merge($placeholders, $customUserFieldsPlaceholders);
130 $completionDate = $this->participantsHelper->getDateTimeOfPassed($objId, $userId);
132 $completionDate = $this->lpStatusHelper->lookupStatusChanged($objId, $userId);
136 $placeholders[
'DATE_COMPLETED'] = $this->dateHelper->formatDate($completionDate);
137 $placeholders[
'DATETIME_COMPLETED'] = $this->dateHelper->formatDateTime($completionDate);
140 $placeholders[
'COURSE_TITLE'] = $this->ilUtilHelper->prepareFormOutput($courseObject->getTitle());
142 return $placeholders;
159 $placeholders = $this->defaultPlaceholderValuesObject->getPlaceholderValuesForPreview($userId, $objId);
161 $customUserFieldsPlaceholders = $this->customUserFieldsPlaceholderValuesObject->getPlaceholderValuesForPreview(
166 $placeholders = array_merge($placeholders, $customUserFieldsPlaceholders);
168 $object = $this->objectHelper->getInstanceByObjId($objId);
172 return $placeholders;
ilCertificateUtilHelper $ilUtilHelper
ilCertificateObjectHelper $objectHelper
ilCertificateParticipantsHelper $participantsHelper
Collection of basic placeholder values that can be used.
getPlaceholderValues(int $userId, int $objId)
This method MUST return an array that contains the actual data for the given user of the given object...
ilObjectCustomUserFieldsPlaceholderValues $customUserFieldsPlaceholderValuesObject
getPlaceholderValuesForPreview(int $userId, int $objId)
This method is different then the 'getPlaceholderValues' method, this method is used to create a plac...
ilCertificateLPStatusHelper $lpStatusHelper
loadLanguageModule(string $a_module)
Load language module.
ilCertificateDateHelper $dateHelper
__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)
Just a wrapper class to create Unit Test for other classes.
hasCompletionDate($possibleDate)
ilDefaultPlaceholderValues $defaultPlaceholderValuesObject