ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilCertificatePdfAction Class Reference
+ Collaboration diagram for ilCertificatePdfAction:

Public Member Functions

 __construct (ilLogger $logger, ilPdfGenerator $pdfGenerator, ?ilCertificateUtilHelper $ilUtilHelper=null, string $translatedErrorText='', ?ilErrorHandling $errorHandler=null)
 
 createPDF (int $userId, int $objectId)
 
 downloadPdf (int $userId, int $objectId)
 

Private Attributes

ilLogger $logger
 
ilPdfGenerator $pdfGenerator
 
ilCertificateUtilHelper $ilUtilHelper
 
ilErrorHandling $errorHandler
 
string $translatedErrorText
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCertificatePdfAction::__construct ( ilLogger  $logger,
ilPdfGenerator  $pdfGenerator,
?ilCertificateUtilHelper  $ilUtilHelper = null,
string  $translatedErrorText = '',
?ilErrorHandling  $errorHandler = null 
)

Definition at line 32 of file class.ilCertificatePdfAction.php.

References $DIC, $errorHandler, $ilUtilHelper, $logger, $pdfGenerator, $translatedErrorText, and ILIAS\Repository\logger().

38  {
39  $this->logger = $logger;
40  $this->pdfGenerator = $pdfGenerator;
41  if (null === $ilUtilHelper) {
43  }
44  $this->ilUtilHelper = $ilUtilHelper;
45 
46  if (null === $errorHandler) {
47  global $DIC;
48  $errorHandler = $DIC['ilErr'];
49  }
50  $this->errorHandler = $errorHandler;
51 
52  $this->translatedErrorText = $translatedErrorText;
53  }
global $DIC
Definition: feed.php:28
Just a wrapper class to create Unit Test for other classes.
ilCertificateUtilHelper $ilUtilHelper
+ Here is the call graph for this function:

Member Function Documentation

◆ createPDF()

ilCertificatePdfAction::createPDF ( int  $userId,
int  $objectId 
)

Definition at line 55 of file class.ilCertificatePdfAction.php.

Referenced by ilCertificateVerificationFileService\createFile(), downloadPdf(), and ilTestEvaluationGUI\exportCertificate().

55  : string
56  {
57  return $this->pdfGenerator->generateCurrentActiveCertificate($userId, $objectId);
58  }
+ Here is the caller graph for this function:

◆ downloadPdf()

ilCertificatePdfAction::downloadPdf ( int  $userId,
int  $objectId 
)

Definition at line 60 of file class.ilCertificatePdfAction.php.

References createPDF().

Referenced by ilLTIConsumerSettingsGUI\deliverCertificateCmd(), ilCmiXapiSettingsGUI\deliverCertificateCmd(), ilObjStudyProgrammeGUI\deliverCertificateObject(), ilObjCourseGUI\deliverCertificateObject(), ilUserCertificateApiGUI\download(), ilUserCertificateGUI\download(), ilSCORMPresentationGUI\downloadCertificate(), ilTestEvaluationGUI\outCertificate(), and ilObjExerciseGUI\outCertificateObject().

60  : string
61  {
62  try {
63  $pdfScalar = $this->createPDF($userId, $objectId);
64 
65  $fileName = $this->pdfGenerator->generateFileName($userId, $objectId);
66 
67  $this->ilUtilHelper->deliverData(
68  $pdfScalar,
69  $fileName,
70  'application/pdf'
71  );
72  } catch (ilException $clientException) {
73  $this->errorHandler->raiseError($this->translatedErrorText, $this->errorHandler->MESSAGE);
74  return '';
75  }
76 
77  return $pdfScalar;
78  }
createPDF(int $userId, int $objectId)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $errorHandler

ilErrorHandling ilCertificatePdfAction::$errorHandler
private

Definition at line 29 of file class.ilCertificatePdfAction.php.

Referenced by __construct().

◆ $ilUtilHelper

ilCertificateUtilHelper ilCertificatePdfAction::$ilUtilHelper
private

Definition at line 28 of file class.ilCertificatePdfAction.php.

Referenced by __construct().

◆ $logger

ilLogger ilCertificatePdfAction::$logger
private

Definition at line 26 of file class.ilCertificatePdfAction.php.

Referenced by __construct().

◆ $pdfGenerator

ilPdfGenerator ilCertificatePdfAction::$pdfGenerator
private

Definition at line 27 of file class.ilCertificatePdfAction.php.

Referenced by __construct().

◆ $translatedErrorText

string ilCertificatePdfAction::$translatedErrorText
private

Definition at line 30 of file class.ilCertificatePdfAction.php.

Referenced by __construct().


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