19 declare(strict_types=1);
62 $this->
logger = $logger ?? $DIC->logger()->cert();
63 $this->object_data_cache = $object_data_cache ?? $DIC[
'ilObjDataCache'];
81 return $this->user_data_repository->getUserData($filter, $ilCtrlStack);
86 return $this->user_data_repository->getUserCertificateDataMaxCount($filter);
92 $this->
logger->debug(sprintf(
93 'Did not trigger certificate achievement for inactive template: usr_id: %s/obj_id: %s/type: %s/template_id: %s',
110 $type = $this->object_data_cache->lookupType($obj_id);
111 if (!$this->type_class_map->typeExistsInMap($type)) {
113 "Oject type '%s' is not supported by the certificate component!",
118 $template = $this->template_repository->fetchCurrentlyActiveCertificate($obj_id);
126 return $this->template_repository->fetchCurrentlyActiveCertificate($obj_id)->isCurrentlyActive();
142 $this->
logger->debug(sprintf(
143 'Trigger persisting certificate achievement for: usr_id: %s/obj_id: %s/type: %s/template_id: %s',
153 $this->type_class_map->getPlaceHolderClassNameByType($template->
getObjType()),
159 $mode = (
new ilSetting(
'certificate'))->
get(
160 'persistent_certificate_mode',
161 'persistent_certificate_mode_cron' 163 if ($mode ===
'persistent_certificate_mode_instant') {
166 $cronjob->processEntry(0, $entry, []);
170 $this->queue_repository->addToQueue($entry);
isActiveCertificateTemplateAvailableFor(int $obj_id)
certificateCriteriaMet(int $usr_id, int $obj_id)
readonly ilObjectDataCache $object_data_cache
getUserCertificateDataMaxCount(UserDataFilter $filter)
processEntry(int $userId, ilCertificateTemplate $template)
readonly ilCertificateTypeClassMap $type_class_map
readonly ilCertificateQueueRepository $queue_repository
readonly UserDataRepository $user_data_repository
readonly ilLogger $logger
getUserCertificateData(UserDataFilter $filter, array $ilCtrlStack=[])
certificateCriteriaMetForGivenTemplate(int $usr_id, ilCertificateTemplate $template)
__construct(?UserDataRepository $user_data_repository=null, ?ilCertificateTemplateRepository $template_repository=null, ?ilCertificateQueueRepository $queue_repository=null, ?ilCertificateTypeClassMap $type_class_map=null, ?ilLogger $logger=null, ?ilObjectDataCache $object_data_cache=null,)
readonly ilCertificateTemplateRepository $template_repository