ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilCertificatePathFactory.php
Go to the documentation of this file.
1<?php
2
19declare(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() . '/',
35 default => throw new ilException(sprintf(
36 'The type "%s" is currently not supported for certificates',
37 $type
38 )),
39 };
40 }
41}
Base class for ILIAS Exception handling.
Class ilObject Basic functions for all objects.