19 declare(strict_types=1);
39 public function preLoad(
int $userId, array $objIds): void
41 if (!array_key_exists($userId, self::$certificates)) {
42 self::$certificates[$userId] = [];
45 $objectIdsWithUserCertificate = $this->userCertificateRepository->fetchObjectIdsWithCertificateForUser(
47 array_diff($objIds, self::$certificates[$userId])
50 self::$certificates[$userId] = array_unique(array_merge(
51 $objectIdsWithUserCertificate,
52 self::$certificates[$userId]
58 if (
false === array_key_exists($userId, self::$certificates)) {
62 if (
true === in_array($objId, self::$certificates[$userId],
true)) {
isPreloaded(int $userId, int $objId)
ilUserCertificateRepository $userCertificateRepository
static array $certificates
__construct(ilUserCertificateRepository $userCertificateRepository)
preLoad(int $userId, array $objIds)