47 $objectType = $userCertificate->getObjType();
49 $this->
language->loadLanguageModule(
'cert');
51 $verificationObjectType = $this->classMap->getVerificationTypeByType($objectType);
54 $verificationObject->setTitle($userCertificatePresentation->
getObjectTitle());
57 $objectId = $userCertificate->getObjId();
58 $userId = $userCertificate->getUserId();
62 $verificationObject->setProperty(
'issued_on', $issueDate);
70 $this->
language->txt(
'error_creating_certificate_pdf')
73 $certificateScalar = $pdfAction->
createPDF($userId, $objectId);
75 if ($certificateScalar) {
77 $verificationObject->create();
81 $fileName = $objectType .
'_' . $objectId .
'_' . $userId .
'.pdf';
83 if (file_put_contents(
$path . $fileName, $certificateScalar)) {
84 $verificationObject->setProperty(
'file', $fileName);
85 $verificationObject->update();
87 return $verificationObject;
90 $this->
logger->info(
'File could not be created');
91 $verificationObject->delete();
96 public function initStorage(
int $objectId,
string $subDirectory =
''): string
101 $path = $storage->getAbsolutePath() .
"/";
103 if ($subDirectory !==
'') {
104 $path .= $subDirectory .
"/";
106 if (!is_dir(
$path)) {
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(ilLanguage $language, ilDBInterface $database, ilLogger $logger, ilCertificateVerificationClassMap $classMap)
ilCertificateVerificationClassMap $classMap
initStorage(int $objectId, string $subDirectory='')
createFile(ilUserCertificatePresentation $userCertificatePresentation)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
createPDF(int $userId, int $objectId)
language()
description: > Example for rendring a language glyph.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...