ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilExcCronReminders.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
4
12{
16 protected $lng;
17
18
22 public function __construct()
23 {
24 global $DIC;
25
26 $this->lng = $DIC->language();
27 }
28
29 public function getId()
30 {
31 return "exc_reminders";
32 }
33
34 public function getTitle()
35 {
37
38 $lng->loadLanguageModule("exc");
39
40 return $lng->txt("exc_reminders_cron");
41 }
42
43 public function getDescription()
44 {
46
47 $lng->loadLanguageModule("exc");
48
49 return $lng->txt("exc_reminders_cron_info");
50 }
51
52 public function getDefaultScheduleType()
53 {
55 }
56
57 public function getDefaultScheduleValue()
58 {
59 return;
60 }
61
62 public function hasAutoActivation()
63 {
64 return true;
65 }
66
67 public function hasFlexibleSchedule()
68 {
69 return true;
70 }
71
72 public function run()
73 {
75 $log->debug("--- Start Exercise Reminders Cron");
76
78 $message = "";
79 $reminder = new ilExAssignmentReminder();
80 $num_reminders = $reminder->checkReminders();
81
82 $this->lng->loadLanguageModule("exc");
83
84 if ($num_reminders) {
85 $cron_status = ilCronJobResult::STATUS_OK;
86 $message = $this->lng->txt('exc_reminder_cron_ok');
87 }
88
89 $cron_result = new ilCronJobResult();
90 $cron_result->setStatus($cron_status);
91
92 if ($message != "") {
93 $cron_result->setMessage($message . " " . $num_reminders);
94 $cron_result->setCode("#" . $num_reminders);
95 }
96
97 return $cron_result;
98 }
99}
An exception for terminatinating execution or to throw for unit testing.
Cron job result data container.
Cron job application base class.
const SCHEDULE_TYPE_DAILY
TODO: import/export reminder data with the exercise/assignment.
Cron for exercise reminders.
hasFlexibleSchedule()
Can the schedule be configured?
getDefaultScheduleValue()
Get schedule value.
hasAutoActivation()
Is to be activated on "installation".
getDefaultScheduleType()
Get schedule type.
getDescription()
Get description.
static getLogger($a_component_id)
Get component logger.
global $DIC
Definition: goto.php:24
$log
Definition: result.php:15
$message
Definition: xapiexit.php:14