ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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

 $logger
 
 $pdfGenerator
 
 $ilUtilHelper
 
 $errorHandler
 
 $translatedErrorText
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, $errorHandler, $ilUtilHelper, $logger, $pdfGenerator, and $translatedErrorText.

47  {
48  $this->logger = $logger;
49  $this->pdfGenerator = $pdfGenerator;
50  if (null == $ilUtilHelper) {
51  $ilUtilHelper = new ilCertificateUtilHelper();
52  }
53  $this->ilUtilHelper = $ilUtilHelper;
54 
55  if (null === $errorHandler) {
56  global $DIC;
57  $errorHandler = $DIC['ilErr'];
58  }
59  $this->errorHandler = $errorHandler;
60 
61  $this->translatedErrorText = $translatedErrorText;
62  }
global $DIC
Definition: saml.php:7
Just a wrapper class to create Unit Test for other classes.

Member Function Documentation

◆ createPDF()

ilCertificatePdfAction::createPDF ( int  $userId,
int  $objectId 
)
Parameters
integer$objectId
integer$userId
Returns
string
Exceptions
ilException

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

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

70  : string
71  {
72  $pdfScalar = $this->pdfGenerator->generateCurrentActiveCertificate($userId, $objectId);
73 
74  return $pdfScalar;
75  }
+ Here is the caller graph for this function:

◆ downloadPdf()

ilCertificatePdfAction::downloadPdf ( int  $userId,
int  $objectId 
)
Parameters
int$userId
int$objectId
string$pdfDownloadName
Returns
string

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

References createPDF().

Referenced by ilObjCourseGUI\deliverCertificateObject(), ilUserCertificateGUI\download(), ilSCORMPresentationGUI\downloadCertificate(), ilTestEvaluationGUI\outCertificate(), and ilObjExerciseGUI\outCertificateObject().

83  : string
84  {
85  try {
86  $pdfScalar = $this->createPDF($userId, $objectId);
87 
88  $fileName = $this->pdfGenerator->generateFileName($userId, $objectId);
89 
90  $this->ilUtilHelper->deliverData(
91  $pdfScalar,
92  $fileName,
93  'application/pdf'
94  );
95  } catch (ilException $clientException) {
96  $this->errorHandler->raiseError($this->translatedErrorText, $this->errorHandler->MESSAGE);
97  return '';
98  }
99 
100  return $pdfScalar;
101  }
createPDF(int $userId, int $objectId)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $errorHandler

ilCertificatePdfAction::$errorHandler
private

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

Referenced by __construct().

◆ $ilUtilHelper

ilCertificatePdfAction::$ilUtilHelper
private

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

Referenced by __construct().

◆ $logger

ilCertificatePdfAction::$logger
private

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

Referenced by __construct().

◆ $pdfGenerator

ilCertificatePdfAction::$pdfGenerator
private

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

Referenced by __construct().

◆ $translatedErrorText

ilCertificatePdfAction::$translatedErrorText
private

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

Referenced by __construct().


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