ILIAS  release_8 Revision v8.24
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.

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 }
ilCertificateUtilHelper $ilUtilHelper
Just a wrapper class to create Unit Test for other classes.
global $DIC
Definition: feed.php:28

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

+ 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.

55 : string
56 {
57 return $this->pdfGenerator->generateCurrentActiveCertificate($userId, $objectId);
58 }

Referenced by downloadPdf().

+ Here is the caller graph for this function:

◆ downloadPdf()

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

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

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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References createPDF().

+ Here is the call 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: