19declare(strict_types=1);
30 private readonly
string $error_txt =
'',
47 public function createPDF(
int $userId,
int $objectId): string
49 return $this->pdf_generator->generateCurrentActiveCertificate($userId, $objectId);
52 public function downloadPdf(
int $userId,
int $objectId): string
55 $pdf_scalar = $this->
createPDF($userId, $objectId);
57 $filename = $this->pdf_generator->generateFileName($userId, $objectId);
59 $this->helper->deliverData(
64 }
catch (Throwable
$e) {
66 'Error while generating or downloading certificate PDF for user {user_id} and object {object_id}: {error}',
69 'object_id' => $objectId,
70 'error' =>
$e->getMessage(),
75 $this->error_handler->raiseError($this->error_txt, $this->error_handler->MESSAGE);
downloadPdf(int $userId, int $objectId)
createPDF(int $userId, int $objectId)
__construct(private readonly ilPdfGenerator $pdf_generator, ?ilCertificateUtilHelper $helper=null, private readonly string $error_txt='', ?ilErrorHandling $error_handler=null)
withLogger(ilLogger $logger)
readonly ilCertificateUtilHelper $helper
readonly ilErrorHandling $error_handler
Just a wrapper class to create Unit Test for other classes.
Error Handling & global info handling.
Component logger with individual log levels by component id.