ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilCertificateDownloadValidator Class Reference

Validates if an active certificate is stored in the database and can be downloaded by the user. More...

+ Collaboration diagram for ilCertificateDownloadValidator:

Public Member Functions

 __construct (ilCertificateUserCertificateAccessValidator $userCertificateAccessValidator=null, ilCertificateActiveValidator $activeValidator=null)
 
 isCertificateDownloadable (int $userId, int $objId)
 

Private Attributes

 $userCertificateAccessValidator
 
 $activeValidator
 

Detailed Description

Validates if an active certificate is stored in the database and can be downloaded by the user.

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

Definition at line 11 of file class.ilCertificateDownloadValidator.php.

Constructor & Destructor Documentation

◆ __construct()

ilCertificateDownloadValidator::__construct ( ilCertificateUserCertificateAccessValidator  $userCertificateAccessValidator = null,
ilCertificateActiveValidator  $activeValidator = null 
)
Parameters
ilCertificateUserCertificateAccessValidator | null$userCertificateAccessValidator
ilCertificateActiveValidator | null$activeValidator

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

References $activeValidator, and $userCertificateAccessValidator.

30  {
31  if (null === $userCertificateAccessValidator) {
32  $userCertificateAccessValidator = new ilCertificateUserCertificateAccessValidator();
33  }
34  $this->userCertificateAccessValidator = $userCertificateAccessValidator;
35 
36  if (null === $activeValidator) {
37  $activeValidator = new ilCertificateActiveValidator();
38  }
39  $this->activeValidator = $activeValidator;
40  }

Member Function Documentation

◆ isCertificateDownloadable()

ilCertificateDownloadValidator::isCertificateDownloadable ( int  $userId,
int  $objId 
)
Parameters
int$userId
int$objId
Returns
bool

Definition at line 47 of file class.ilCertificateDownloadValidator.php.

48  {
49  if (false === $this->activeValidator->validate()) {
50  return false;
51  }
52 
53  return $this->userCertificateAccessValidator->validate($userId, $objId);
54  }

Field Documentation

◆ $activeValidator

ilCertificateDownloadValidator::$activeValidator
private

Definition at line 21 of file class.ilCertificateDownloadValidator.php.

Referenced by __construct().

◆ $userCertificateAccessValidator

ilCertificateDownloadValidator::$userCertificateAccessValidator
private

Definition at line 16 of file class.ilCertificateDownloadValidator.php.

Referenced by __construct().


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