19declare(strict_types=1);
60 $this->
logger = $logger ??
$DIC->logger()->cert();
78 return $this->user_data_repository->getUserData($filter, $ilCtrlStack);
83 return $this->user_data_repository->getUserCertificateDataMaxCount($filter);
91 'Did not trigger certificate achievement for inactive template: usr_id: %s/obj_id: %s/type: %s/template_id: %s',
109 $type = $this->object_data_cache->lookupType($obj_id);
110 if (!$this->type_class_map->typeExistsInMap($type)) {
113 "Oject type '%s' is not supported by the certificate component!",
119 $template = $this->template_repository->fetchCurrentlyActiveCertificate($obj_id);
120 if ($template->getObjType() !== $type) {
122 'Object type mismatch between template and determined type for object with id {obj_id}: '
123 .
'Expected {type} but got {template_type}!',
127 'template_type' => $template->getObjType()
138 return $this->template_repository->fetchCurrentlyActiveCertificate($obj_id)->isCurrentlyActive();
156 'Trigger persisting certificate achievement for: usr_id: %s/obj_id: %s/type: %s/template_id: %s',
158 $template->getObjId(),
159 $template->getObjType(),
167 $this->type_class_map->getPlaceHolderClassNameByType($template->
getObjType()),
173 $mode = (
new ilSetting(
'certificate'))->
get(
174 'persistent_certificate_mode',
175 'persistent_certificate_mode_cron'
177 if ($mode ===
'persistent_certificate_mode_instant') {
180 $cronjob->processEntry(0, $entry, []);
184 $this->queue_repository->addToQueue($entry);
readonly ilObjectDataCache $object_data_cache
certificateCriteriaMetForGivenTemplate(int $usr_id, ilCertificateTemplate $template)
__construct(?UserDataRepository $user_data_repository=null, ?ilCertificateTemplateRepository $template_repository=null, ?ilCertificateQueueRepository $queue_repository=null, private readonly ilCertificateTypeClassMap $type_class_map=new ilCertificateTypeClassMap(), ?ilLogger $logger=null, ?ilObjectDataCache $object_data_cache=null,)
readonly ilCertificateTemplateRepository $template_repository
processEntry(int $userId, ilCertificateTemplate $template)
readonly ilLogger $logger
readonly UserDataRepository $user_data_repository
getUserCertificateData(UserDataFilter $filter, array $ilCtrlStack=[])
getUserCertificateDataMaxCount(UserDataFilter $filter)
certificateCriteriaMet(int $usr_id, int $obj_id)
isActiveCertificateTemplateAvailableFor(int $obj_id)
readonly ilCertificateQueueRepository $queue_repository
Component logger with individual log levels by component id.