19 declare(strict_types=1);
60 if (
null === $language) {
62 $language = $DIC->language();
63 $language->loadLanguageModule(
'certificate');
66 if (
null === $defaultPlaceholderValues) {
70 if (
null === $customUserFieldsPlaceholderValues) {
74 if (
null === $objectHelper) {
79 if (
null === $participantsHelper) {
84 if (
null === $dateHelper) {
89 if (
null === $lpStatusHelper) {
94 $this->customUserFieldsPlaceholderValuesObject = $customUserFieldsPlaceholderValues;
95 $this->defaultPlaceholderValuesObject = $defaultPlaceholderValues;
104 $possibleDate !==
false &&
105 $possibleDate !==
null &&
124 $courseObject = $this->objectHelper->getInstanceByObjId($objId);
126 $placeholders = $this->defaultPlaceholderValuesObject->getPlaceholderValues($userId, $objId);
128 $customUserFieldsPlaceholders = $this->customUserFieldsPlaceholderValuesObject->getPlaceholderValues(
133 $placeholders = array_merge($placeholders, $customUserFieldsPlaceholders);
135 $completionDate = $this->participantsHelper->getDateTimeOfPassed($objId, $userId);
137 $completionDate = $this->lpStatusHelper->lookupStatusChanged($objId, $userId);
141 $user = $this->objectHelper->getInstanceByObjId($userId);
143 $placeholders[
'DATE_COMPLETED'] = $this->dateHelper->formatDate($completionDate, $user);
144 $placeholders[
'DATETIME_COMPLETED'] = $this->dateHelper->formatDateTime($completionDate, $user);
147 $lng_code = $user->getLanguage();
148 $course_translation = $courseObject->getObjectTranslation();
149 $title = $courseObject->getTitle();
151 $languages = $course_translation->getLanguages();
152 foreach ($languages as $trans) {
153 if ($trans->getLanguageCode() === $lng_code) {
154 $title = $trans->getTitle();
163 return $placeholders;
177 $placeholders = $this->defaultPlaceholderValuesObject->getPlaceholderValuesForPreview($userId, $objId);
179 $customUserFieldsPlaceholders = $this->customUserFieldsPlaceholderValuesObject->getPlaceholderValuesForPreview(
184 $placeholders = array_merge($placeholders, $customUserFieldsPlaceholders);
186 $object = $this->objectHelper->getInstanceByObjId($objId);
190 return $placeholders;
__construct(?ilObjectCustomUserFieldsPlaceholderValues $customUserFieldsPlaceholderValues=null, ?ilDefaultPlaceholderValues $defaultPlaceholderValues=null, ?ilLanguage $language=null, ?ilCertificateObjectHelper $objectHelper=null, ?CertificateParticipantsHelper $participantsHelper=null, ?ilCertificateDateHelper $dateHelper=null, ?ilCertificateLPStatusHelper $lpStatusHelper=null)
readonly CertificateParticipantsHelper $participantsHelper
hasCompletionDate($possibleDate)
readonly ilObjectCustomUserFieldsPlaceholderValues $customUserFieldsPlaceholderValuesObject
readonly ilCertificateLPStatusHelper $lpStatusHelper
readonly ilCertificateDateHelper $dateHelper
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
readonly ilDefaultPlaceholderValues $defaultPlaceholderValuesObject
getPlaceholderValues(int $userId, int $objId)
This method MUST return an array that contains the actual data for the given user of the given object...
readonly ilCertificateObjectHelper $objectHelper
getPlaceholderValuesForPreview(int $userId, int $objId)
This method is different then the 'getPlaceholderValues' method, this method is used to create a plac...