ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilCertificateFactory Class Reference
+ Collaboration diagram for ilCertificateFactory:

Public Member Functions

 create (ilObject $object)
 

Detailed Description

Author
Niels Theen nthee.nosp@m.n@da.nosp@m.tabay.nosp@m..de

Definition at line 7 of file class.ilCertificateFactory.php.

Member Function Documentation

◆ create()

ilCertificateFactory::create ( ilObject  $object)
Parameters
ilObject$object
Returns
ilCertificate
Exceptions
ilException

Definition at line 14 of file class.ilCertificateFactory.php.

15 {
16 $type = $object->getType();
17
18 switch ($type) {
19 case 'tst':
20 $adapter = new ilTestCertificateAdapter($object);
21 $placeholderDescriptionObject = new ilTestPlaceholderDescription();
22 $placeholderValuesObject = new ilTestPlaceholderValues();
23 $certificatePath = ilCertificatePathConstants::TEST_PATH . $object->getId() . '/';
24 break;
25 case 'crs':
26 $adapter = new ilCourseCertificateAdapter($object);
27 $placeholderDescriptionObject = new ilCoursePlaceholderDescription();
28 $placeholderValuesObject = new ilCoursePlaceholderValues();
29 $certificatePath = ilCertificatePathConstants::COURSE_PATH . $object->getId() . '/';
30 break;
31 case 'scrm':
32 $adapter = new ilSCORMCertificateAdapter($object);
33 $placeholderDescriptionObject = new ilScormPlaceholderDescription($object);
34 $placeholderValuesObject = new ilScormPlaceholderValues();
35 $certificatePath = ilCertificatePathConstants::SCORM_PATH . $object->getId() . '/';
36 break;
37 case 'exc':
38 $adapter = new ilExerciseCertificateAdapter($object);
39 $placeholderDescriptionObject = new ilExercisePlaceholderDescription();
40 $placeholderValuesObject = new ilExercisePlaceholderValues();
41 $certificatePath = ilCertificatePathConstants::EXERCISE_PATH . $object->getId() . '/';
42 break;
43 default:
44 throw new ilException(sprintf(
45 'The type "%s" is currently not supported for certificates',
46 $type
47 ));
48 break;
49 }
50
52 $adapter,
53 $placeholderDescriptionObject,
54 $placeholderValuesObject,
55 $object->getId(),
56 $certificatePath
57 );
58
59 return $certificate;
60 }
Create PDF certificates.
Base class for ILIAS Exception handling.
getType()
get object type @access public
getId()
get object id @access public
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
Definition: example_052.php:77
$type

References $certificate, $type, ilCertificatePathConstants\COURSE_PATH, ilCertificatePathConstants\EXERCISE_PATH, ilObject\getId(), ilObject\getType(), ilCertificatePathConstants\SCORM_PATH, and ilCertificatePathConstants\TEST_PATH.

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: