ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilCertificatePdfFileNameFactory.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
8{
10 private $lng;
11
16 public function __construct(\ilLanguage $lng)
17 {
18 $this->lng = $lng;
19 }
20
21 public function create(ilUserCertificatePresentation $presentation)
22 {
23 $objectType = $presentation->getObjType();
24 $pdfFileGenerator = $this->fetchCertificateGenerator($objectType);
25
26 return $pdfFileGenerator->createFileName($presentation);
27 }
28
33 private function fetchCertificateGenerator(string $objectType) : ilCertificateFilename
34 {
35 $generator = new ilCertificatePdfFilename($this->lng);
36 if ('sahs' === $objectType) {
37 $generator = new ilCertificateScormPdfFilename($generator, $this->lng, new ilSetting('scorm'));
38 }
39
40 return $generator;
41 }
42}
An exception for terminatinating execution or to throw for unit testing.
create(ilUserCertificatePresentation $presentation)
__construct(\ilLanguage $lng)
ilCertificatePdfFileNameFactory constructor.
language handling
ILIAS Setting Class.