ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 ILIAS\COPage\ResourcesCollector\__construct(), ilTestRandomQuestionSetNonAvailablePoolsTableGUI\addColumns(), ilTestRandomQuestionSetSourcePoolDefinitionListTableGUI\addColumns(), ilTooltipGUI\addTooltip(), ilContext\callContext(), ilMathJaxSettingsGUI\editSettings(), ilCOPageObjDef\getDefinitionByParentType(), ilCOPageObjDef\getDefinitions(), ilExplorerBaseGUI\getHTML(), ilAdvancedMDFieldDefinitionFloat\init(), ilPortfolioTemplatePageConfig\init(), ilObjTalkTemplateListGUI\init(), ilObjTalkTemplateAdministrationListGUI\init(), ilObjEmployeeTalkSeriesListGUI\init(), ilObjEmployeeTalkListGUI\init(), ilObjectCopyCourseGroupSelectionTableGUI\init(), ilFSWebStorageExercise\init(), ilFSStorageExercise\init(), ilRestFileStorage\init(), ilInitialisation\initClient(), ilInitialisation\initILIAS(), ilInitialisation\initResourceStorage(), ilUtil\redirect(), ilMultipleImagesInputGUI\render(), SystemStylesGlobalScreenToolProviderTest\setUp(), ExamplesTest\setUpMockDependencies(), InitUIFrameworkTest\testByExampleThatFactoryIsLoaded(), InitUIFrameworkTest\testByExampleThatRendererIsReadyToWork(), InitCtrlServiceTest\testCtrlServiceInitializationSuccess(), InitCtrlServiceTest\testCtrlServiceInitializationWithoutHttpServices(), InitCtrlServiceTest\testCtrlServiceInitializationWithoutRefinery(), InitHttpServicesTest\testUIFrameworkInitialization(), InitUIFrameworkTest\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: feed.php:28
+ 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().

+ 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:33

Definition at line 22 of file ilPRGCertificateHelper.php.