19 declare(strict_types=1);
31 if (null === $language) {
33 $language = $DIC->language();
34 $language->loadLanguageModule(
'certificate');
37 if (null === $defaultPlaceholderValues) {
41 if (null === $objectHelper) {
46 $this->defaultPlaceholderValuesObject = $defaultPlaceholderValues;
61 $object = $this->objectHelper->getInstanceByObjId($objId);
62 $placeholders = $this->defaultPlaceholderValuesObject->getPlaceholderValues($userId, $objId);
64 $latest_progress =
false;
65 $ass_id = $object->getCertificateRelevantAssignmentIds($userId);
67 $latest_progress = $object->getSpecificAssignment(current($ass_id))->getProgressTree();
70 $type = $object->getSubType();
75 $latest_progress ? (
string) $latest_progress->getCurrentAmountOfPoints() :
'' 78 $latest_progress && $latest_progress->getCompletionDate() instanceof
DateTimeImmutable ? $latest_progress->getCompletionDate(
79 )->format(
'd.m.Y') :
'' 82 $latest_progress && $latest_progress->getValidityOfQualification(
83 ) instanceof
DateTimeImmutable ? $latest_progress->getValidityOfQualification()->format(
'd.m.Y') :
'' 95 $placeholders = $this->defaultPlaceholderValuesObject->getPlaceholderValuesForPreview($userId, $objId);
97 $object = $this->objectHelper->getInstanceByObjId($objId);
98 $type = $object->getSubType();
104 $placeholders[
'PRG_COMPLETION_DATE'] = $today;
105 $placeholders[
'PRG_EXPIRES_AT'] = $today;
106 return $placeholders;
Collection of basic placeholder values that can be used.
__construct(?ilDefaultPlaceholderValues $defaultPlaceholderValues=null, ?ilLanguage $language=null, ?ilCertificateObjectHelper $objectHelper=null)
readonly ilDefaultPlaceholderValues $defaultPlaceholderValuesObject
getPlaceholderValuesForPreview(int $userId, int $objId)
This method is different then the 'getPlaceholderValues' method, this method is used to create a plac...
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