ILIAS  trunk Revision v11.0_alpha-1702-gfd3ecb7f852
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilPRGCertificateHelper.php File Reference

Go to the source code of this file.

Functions

 init ()
 
 updateCertificateForPrg (int $obj_id, int $usr_id)
 
 removeCertificateForUser (int $node_id, int $usr_id,)
 
 processEntry (string $class_name, int $obj_id, int $usr_id, \ilCertificateTemplate $template)
 

Variables

trait ilPRGCertificateHelper
 
ilCertificateTemplateRepository $certificate_template_repository
 
ilCertificateTypeClassMap $certificate_type_class_map
 
ilCertificateCron $certificate_cron
 
ilUserCertificateRepository $user_certificate_repository
 

Function Documentation

◆ init()

init ( )

Definition at line 29 of file ilPRGCertificateHelper.php.

References $DIC.

Referenced by ilContext\callContext(), ilMathJaxSettingsGUI\editSettings(), ilCOPageObjDef\getDefinitionByParentType(), ilCOPageObjDef\getDefinitions(), ilExplorerBaseGUI\getHTML(), ilPortfolioTemplatePageConfig\init(), ilObjTalkTemplateListGUI\init(), ilGlossaryExportOptionHTML\init(), ilBlogExportOptionHTML\init(), ilBlogExportOptionHTMLWithComments\init(), ilLearningModuleExportOptionXML\init(), ilHTLMExportOptionHTML\init(), ilDataCollectionExportOptionsXLSX\init(), ilObjEmployeeTalkListGUI\init(), ilObjEmployeeTalkSeriesListGUI\init(), ilMediaPoolExportOptionXMLMaster\init(), ilMediaPoolExportOptionXMLMasterNoMedia\init(), ilObjTalkTemplateAdministrationListGUI\init(), ilWikiExportOptionHTML\init(), ilWikiExportOptionHTMLWithComments\init(), ilTestExportOptionARC\init(), ilLearningModuleExportOptionHTML\init(), ilObjectCopyCourseGroupSelectionTableGUI\init(), ilRestFileStorage\init(), ilInitialisation\initClient(), ilInitialisation\initILIAS(), ilInitialisation\initResourceStorage(), ilUtil\redirect(), ilMultipleImagesInputGUI\render(), SystemStylesGlobalScreenToolProviderTest\setUp(), ExamplesTest\setUpMockDependencies(), InitCtrlServiceTest\testCtrlServiceInitializationSuccess(), InitCtrlServiceTest\testCtrlServiceInitializationWithoutHttpServices(), InitCtrlServiceTest\testCtrlServiceInitializationWithoutRefinery(), InitHttpServicesTest\testUIFrameworkInitialization(), and updateCertificateForPrg().

29  : void
30  {
31  global $DIC;
32  $this->log = $DIC['ilLog'];
33  $this->certificate_type_class_map = new ilCertificateTypeClassMap();
34  $this->certificate_template_repository = new ilCertificateTemplateDatabaseRepository($DIC->database());
35  $this->certificate_cron = new ilCertificateCron();
36  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ processEntry()

processEntry ( string  $class_name,
int  $obj_id,
int  $usr_id,
\ilCertificateTemplate  $template 
)
private

Definition at line 69 of file ilPRGCertificateHelper.php.

References ilCertificateTemplate\getId(), and ilCronConstants\IN_PROGRESS.

Referenced by ilCertificateCron\getDefaultScheduleValue(), ilCertificateCron\run(), and updateCertificateForPrg().

74  : void {
75  $entry = new \ilCertificateQueueEntry(
76  $obj_id,
77  $usr_id,
78  $class_name,
80  (int) $template->getId(),
81  time()
82  );
83  $this->certificate_cron->init();
84  $this->certificate_cron->processEntry(0, $entry, []);
85  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeCertificateForUser()

removeCertificateForUser ( int  $node_id,
int  $usr_id 
)

Definition at line 61 of file ilPRGCertificateHelper.php.

References ilUserCertificateRepository\deleteUserCertificatesForObject().

Referenced by ilObjStudyProgrammeMembersGUI\confirmedRemovalOfCertificate().

64  : void {
67  }
deleteUserCertificatesForObject(int $userId, int $obj_id)
ilUserCertificateRepository $user_certificate_repository
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateCertificateForPrg()

updateCertificateForPrg ( int  $obj_id,
int  $usr_id 
)

Definition at line 38 of file ilPRGCertificateHelper.php.

References init(), and processEntry().

Referenced by ilObjStudyProgrammeMembersGUI\confirmedUpdateCertificate().

41  : bool {
42  try {
43  $this->init();
44  $class_name = $this->certificate_type_class_map->getPlaceHolderClassNameByType('prg');
45  $template = $this->certificate_template_repository->fetchCurrentlyActiveCertificate($obj_id);
46 
47  $this->processEntry(
48  $class_name,
49  $obj_id,
50  $usr_id,
51  $template
52  );
53 
54  return true;
55  } catch (\ilException $exception) {
56  $this->log->warning($exception->getMessage());
57  return false;
58  }
59  }
processEntry(string $class_name, int $obj_id, int $usr_id, \ilCertificateTemplate $template)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ $certificate_cron

ilCertificateCron $certificate_cron
protected

Definition at line 26 of file ilPRGCertificateHelper.php.

◆ $certificate_template_repository

ilCertificateTemplateRepository $certificate_template_repository
protected

Definition at line 24 of file ilPRGCertificateHelper.php.

Referenced by ilObjStudyProgramme\isCertificateActive().

◆ $certificate_type_class_map

ilCertificateTypeClassMap $certificate_type_class_map
protected

Definition at line 25 of file ilPRGCertificateHelper.php.

◆ $user_certificate_repository

ilUserCertificateRepository $user_certificate_repository
protected

Definition at line 27 of file ilPRGCertificateHelper.php.

Referenced by ilTestVerificationTableGUI\__construct().

◆ ilPRGCertificateHelper

trait ilPRGCertificateHelper
Initial value:
{
protected \ilLogger $log
$log
Definition: result.php:32

Definition at line 22 of file ilPRGCertificateHelper.php.