ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilCertificatePdfFileNameFactory.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
25{
26 public function __construct(private readonly ilLanguage $lng)
27 {
28 }
29
30 public function create(ilUserCertificatePresentation $presentation): string
31 {
32 $objectType = $presentation->getObjType();
33
34 return $this->fetchCertificateGenerator($objectType)->createFileName($presentation);
35 }
36
37 private function fetchCertificateGenerator(string $objectType): ilCertificateFilename
38 {
39 $generator = new ilCertificatePdfFilename($this->lng);
40 if ('sahs' === $objectType) {
41 $generator = new ilCertificateScormPdfFilename($generator, $this->lng, new ilSetting('scorm'));
42 }
43
44 return $generator;
45 }
46}
create(ilUserCertificatePresentation $presentation)
language handling
ILIAS Setting Class.
global $lng
Definition: privfeed.php:31