3 declare(strict_types=1);
26 private const ID =
'prg_user_not_restarted';
36 $this->
log = $DIC[
'ilLog'];
37 $this->
lng = $DIC[
'lng'];
38 $this->
lng->loadLanguageModule(
'prg');
41 $this->assignment_repo =
$dic[
'repo.assignment'];
42 $this->adapter =
$dic[
'cron.notRestarted'];
47 return $this->
lng->txt(
'prg_user_not_restarted_title');
52 return $this->
lng->txt(
'prg_user_not_restarted_desc');
72 return self::SCHEDULE_TYPE_IN_DAYS;
85 $programmes_to_send = $this->adapter->getRelevantProgrammeIds();
86 if (count($programmes_to_send) == 0) {
91 $programmes_and_due = [];
92 foreach ($programmes_to_send as $programme_obj_id => $days_offset_mail) {
93 $interval =
new DateInterval(
'P' . $days_offset_mail .
'D');
94 $due = $today->add($interval);
95 $programmes_and_due[$programme_obj_id] = $due;
98 $assignments = $this->assignment_repo->getAboutToExpire($programmes_and_due,
true);
100 if (count($assignments) == 0) {
103 foreach ($assignments as $ass) {
104 $pgs = $ass->getProgressTree();
107 'PRG, UserNotRestarted: user %s\'s qualification is about to expire at assignment %s (prg obj_id %s)',
113 $this->adapter->actOnSingleAssignment($ass);
114 $this->assignment_repo->storeExpiryInfoSentFor($ass);
125 protected function log(
string $msg): void
127 $this->
log->write($msg);
getDefaultScheduleValue()
Component logger with individual log levels by component id.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilPRGAssignmentDBRepository $assignment_repo
ilPrgCronJobAdapter $adapter
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...