ILIAS  release_8 Revision v8.24
class.ilExcCronReminders.php
Go to the documentation of this file.
1<?php
2
26{
27 protected ilLanguage $lng;
28
29 public function __construct()
30 {
31 global $DIC;
32
33 $this->lng = $DIC->language();
34 }
35
36 public function getId(): string
37 {
38 return "exc_reminders";
39 }
40
41 public function getTitle(): string
42 {
44
46
47 return $lng->txt("exc_reminders_cron");
48 }
49
50 public function getDescription(): string
51 {
53
55
56 return $lng->txt("exc_reminders_cron_info");
57 }
58
59 public function getDefaultScheduleType(): int
60 {
62 }
63
64 public function getDefaultScheduleValue(): ?int
65 {
66 return null;
67 }
68
69 public function hasAutoActivation(): bool
70 {
71 return true;
72 }
73
74 public function hasFlexibleSchedule(): bool
75 {
76 return true;
77 }
78
82 public function run(): ilCronJobResult
83 {
85 $log->debug("--- Start Exercise Reminders Cron");
86
88 $message = "";
89 $reminder = new ilExAssignmentReminder();
90 $num_reminders = $reminder->checkReminders();
91
92 $this->lng->loadLanguageModule("exc");
93
94 if ($num_reminders !== 0) {
95 $cron_status = ilCronJobResult::STATUS_OK;
96 $message = $this->lng->txt('exc_reminder_cron_ok');
97 }
98
99 $cron_result = new ilCronJobResult();
100 $cron_result->setStatus($cron_status);
101
102 if ($message != "") {
103 $cron_result->setMessage($message . " " . $num_reminders . ' / ' . "#" . $num_reminders);
104 }
105
106 return $cron_result;
107 }
108}
const SCHEDULE_TYPE_DAILY
@depracated This will be replaced with an ENUM in ILIAS 9
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...
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.
global $DIC
Definition: feed.php:28
$log
Definition: result.php:33
$message
Definition: xapiexit.php:32