19 declare(strict_types=1);
37 ?ServerRequestInterface $request = null,
43 if ($language === null) {
44 $language = $DIC->language();
48 if ($request === null) {
49 $request = $DIC->http()->request();
53 if ($certificateLogger === null) {
54 $certificateLogger = $DIC->logger()->cert();
63 $this->
language->loadLanguageModule(
'cert');
68 $cmd = $this->
ctrl->getCmd();
71 case self::CMD_DOWNLOAD:
83 $pdfGenerator =
new ilPdfGenerator($userCertificateRepository, $this->certificateLogger);
85 $userCertificateId = (
int) $this->request->getQueryParams()[
'certificate_id'];
87 $userCertificate = $userCertificateRepository->fetchCertificate($userCertificateId);
90 $this->certificateLogger,
93 $this->
language->txt(
'error_creating_certificate_pdf')
96 $pdfAction->
downloadPdf($userCertificate->getUserId(), $userCertificate->getObjId());
Class ilPdfGeneratorConstantsTest.
ServerRequestInterface $request
ilLogger $certificateLogger
__construct(?ilLanguage $language=null, ?ServerRequestInterface $request=null, ?ilLogger $certificateLogger=null, ?ilCtrlInterface $ctrl=null)
Just a wrapper class to create Unit Test for other classes.
downloadPdf(int $userId, int $objectId)