ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilExcCronReminders.php
Go to the documentation of this file.
1<?php
2
22
30{
31 protected ilLanguage $lng;
32
33 public function __construct()
34 {
35 global $DIC;
36
37 $this->lng = $DIC->language();
38 }
39
40 public function getId(): string
41 {
42 return "exc_reminders";
43 }
44
45 public function getTitle(): string
46 {
48
50
51 return $lng->txt("exc_reminders_cron");
52 }
53
54 public function getDescription(): string
55 {
57
59
60 return $lng->txt("exc_reminders_cron_info");
61 }
62
64 {
65 return JobScheduleType::DAILY;
66 }
67
68 public function getDefaultScheduleValue(): ?int
69 {
70 return null;
71 }
72
73 public function hasAutoActivation(): bool
74 {
75 return true;
76 }
77
78 public function hasFlexibleSchedule(): bool
79 {
80 return true;
81 }
82
86 public function run(): JobResult
87 {
89 $log->debug("--- Start Exercise Reminders Cron");
90
91 $cron_status = JobResult::STATUS_NO_ACTION;
92 $message = "";
93 $reminder = new ilExAssignmentReminder();
94 $num_reminders = $reminder->checkReminders();
95
96 $this->lng->loadLanguageModule("exc");
97
98 if ($num_reminders !== 0) {
99 $cron_status = JobResult::STATUS_OK;
100 $message = $this->lng->txt('exc_reminder_cron_ok');
101 }
102
103 $cron_result = new JobResult();
104 $cron_result->setStatus($cron_status);
105
106 if ($message != "") {
107 $cron_result->setMessage($message . " " . $num_reminders . ' / ' . "#" . $num_reminders);
108 }
109
110 return $cron_result;
111 }
112}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Cron for exercise reminders.
hasAutoActivation()
Is to be activated on "installation", does only work for ILIAS core cron jobs.
language handling
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getLogger(string $a_component_id)
Get component logger.
$log
Definition: ltiresult.php:34
global $DIC
Definition: shib_login.php:26
$message
Definition: xapiexit.php:31