ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilCertificateUserForObjectPreloader Class Reference
+ Collaboration diagram for ilCertificateUserForObjectPreloader:

Public Member Functions

 __construct (ilUserCertificateRepository $userCertificateRepository, ilCertificateActiveValidator $activeValidator)
 
 preLoadDownloadableCertificates (int $objectId)
 
 isPreloaded (int $objId, int $userId)
 

Private Attributes

 $userCertificateRepository
 
 $activeValidator
 

Static Private Attributes

static $certificates = array()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCertificateUserForObjectPreloader::__construct ( ilUserCertificateRepository  $userCertificateRepository,
ilCertificateActiveValidator  $activeValidator 
)

Member Function Documentation

◆ isPreloaded()

ilCertificateUserForObjectPreloader::isPreloaded ( int  $objId,
int  $userId 
)
Parameters
int$objId
int$userId
Returns
bool

Definition at line 51 of file class.ilCertificateUserForObjectPreloader.php.

52 {
53 if (false === array_key_exists($objId, self::$certificates)) {
54 return false;
55 }
56
57 if (true === in_array($userId, self::$certificates[$objId])) {
58 return true;
59 }
60
61 return false;
62 }
$certificates
Definition: metarefresh.php:39

References $certificates.

◆ preLoadDownloadableCertificates()

ilCertificateUserForObjectPreloader::preLoadDownloadableCertificates ( int  $objectId)
Parameters
int$objectId
array$userIds

Definition at line 38 of file class.ilCertificateUserForObjectPreloader.php.

39 {
40 if (true === $this->activeValidator->validate()) {
41 $objectIdsWithUserCertificate = $this->userCertificateRepository->fetchUserIdsWithCertificateForObject($objectId);
42 self::$certificates[$objectId] = $objectIdsWithUserCertificate;
43 }
44 }

References $certificates.

Field Documentation

◆ $activeValidator

ilCertificateUserForObjectPreloader::$activeValidator
private

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

Referenced by __construct().

◆ $certificates

ilCertificateUserForObjectPreloader::$certificates = array()
staticprivate

◆ $userCertificateRepository

ilCertificateUserForObjectPreloader::$userCertificateRepository
private

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

Referenced by __construct().


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