19declare(strict_types=1);
37 private readonly
int $objectId,
38 private readonly
string $certificatePath,
40 private readonly IRSS $irss,
62 $type = $this->objectHelper->lookupType($this->objectId);
63 $certificateId = $this->objectId;
65 $exportPath = $this->certificatePath . $time .
'__' . $installationId .
'__' . $type .
'__' . $certificateId .
'__certificate/';
69 $template = $this->templateRepository->fetchCurrentlyUsedCertificate($this->objectId);
71 $streams[
'certificate.xml'] = Streams::ofString(
72 $template->getCertificateContent()
75 $background_rid = $this->irss->manage()->find($template->getBackgroundImageIdentification());
77 $streams[
'background.jpg'] = $this->irss->consume()->stream($background_rid)->getStream();
80 $tile_image_rid = $this->irss->manage()->find($template->getTileImageIdentification());
82 $streams[
'tile_image.svg'] = $this->irss->consume()->stream($tile_image_rid)->getStream();
85 $objectType = $this->objectHelper->lookupType($this->objectId);
87 $zipFileName = $time .
'__' . $installationId .
'__' . $objectType .
'__' . $this->objectId .
'__certificate.zip';
89 $this->utilHelper->zipAndDeliver($streams, $zipFileName);
Indicates that a file is missing or not found.
Indicates general problems with the input or output operations.
Stream factory which enables the user to create streams without the knowledge of the concrete class.
Class ResourceIdentification.
export(string $rootDir=CLIENT_WEB_DIR, string $installationId=IL_INST_ID)
Creates a downloadable file via the browser.
readonly ilCertificateObjectHelper $objectHelper
__construct(private readonly int $objectId, private readonly string $certificatePath, private readonly ilCertificateTemplateRepository $templateRepository, private readonly IRSS $irss, ?ilCertificateObjectHelper $objectHelper=null, ?ilCertificateUtilHelper $utilHelper=null)
readonly ilCertificateUtilHelper $utilHelper
Just a wrapper class to create Unit Test for other classes.