ILIAS  release_7 Revision v7.30-3-g800a261c036
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.

47 {
48 $this->logger = $logger;
49 $this->pdfGenerator = $pdfGenerator;
50 if (null == $ilUtilHelper) {
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 }
Just a wrapper class to create Unit Test for other classes.
global $DIC
Definition: goto.php:24

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

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.

70 : string
71 {
72 $pdfScalar = $this->pdfGenerator->generateCurrentActiveCertificate($userId, $objectId);
73
74 return $pdfScalar;
75 }

Referenced by downloadPdf().

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

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)
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

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: