ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 {
9  public function create(ilUserCertificatePresentation $presentation)
10  {
11  $objectType = $presentation->getUserCertificate()->getObjType();
12  $pdfFileGenerator = $this->fetchCertificateGenerator($objectType);
13 
14  $fileName = $pdfFileGenerator->createFileName($presentation);
15 
16  return $fileName . '.pdf';
17  }
18 
23  private function fetchCertificateGenerator(string $objectType)
24  {
25  if ($objectType === 'sahs') {
26  return new ilCertificateScormPdfFilename(new ilSetting('scorm'));
27  }
28 
29  return new ilCertificatePdfFilename();
30  }
31 }
create(ilUserCertificatePresentation $presentation)