19 declare(strict_types=1);
37 private readonly
int $objectId,
38 private readonly
string $certificatePath,
40 private readonly
IRSS $irss,
44 if (
null === $objectHelper) {
49 if (
null === $utilHelper) {
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());
81 if ($tile_image_rid instanceof ResourceIdentification) {
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);
readonly ilCertificateObjectHelper $objectHelper
export(string $rootDir=CLIENT_WEB_DIR, string $installationId=IL_INST_ID)
Creates a downloadable file via the browser.
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...
Class ResourceIdentification.
readonly ilCertificateUtilHelper $utilHelper
__construct(private readonly int $objectId, private readonly string $certificatePath, private readonly ilCertificateTemplateRepository $templateRepository, private readonly IRSS $irss, ?ilCertificateObjectHelper $objectHelper=null, ?ilCertificateUtilHelper $utilHelper=null)