ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilCertificatePathFactory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
23  public function create(ilObject $object): string
24  {
25  $type = $object->getType();
26 
27  return match ($type) {
28  'tst' => ilCertificatePathConstants::TEST_PATH . $object->getId() . '/',
29  'crs' => ilCertificatePathConstants::COURSE_PATH . $object->getId() . '/',
30  'sahs' => ilCertificatePathConstants::SCORM_PATH . $object->getId() . '/',
31  'exc' => ilCertificatePathConstants::EXERCISE_PATH . $object->getId() . '/',
32  'lti' => ilCertificatePathConstants::LTICON_PATH . $object->getId() . '/',
33  'cmix' => ilCertificatePathConstants::CMIX_PATH . $object->getId() . '/',
34  'prg' => ilCertificatePathConstants::STUDY_PROGRAMME_PATH . $object->getId() . '/',
35  default => throw new ilException(sprintf(
36  'The type "%s" is currently not supported for certificates',
37  $type
38  )),
39  };
40  }
41 }