ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilExcCronReminders Class Reference

Cron for exercise reminders. More...

+ Inheritance diagram for ilExcCronReminders:
+ Collaboration diagram for ilExcCronReminders:

Public Member Functions

 __construct ()
 
 getId ()
 
 getTitle ()
 
 getDescription ()
 
 getDefaultScheduleType ()
 
 getDefaultScheduleValue ()
 
 hasAutoActivation ()
 
 hasFlexibleSchedule ()
 
 run ()
 
- Public Member Functions inherited from ilCronJob
 setDateTimeProvider (?Closure $date_time_provider)
 
 isDue (?DateTimeImmutable $last_run, ?CronJobScheduleType $schedule_type, ?int $schedule_value, bool $is_manually_executed=false)
 
 getScheduleType ()
 Get current schedule type (if flexible) More...
 
 getScheduleValue ()
 Get current schedule value (if flexible) More...
 
 setSchedule (?CronJobScheduleType $a_type, ?int $a_value)
 Update current schedule (if flexible) More...
 
 getAllScheduleTypes ()
 Get all available schedule types. More...
 
 getScheduleTypesWithValues ()
 
 getValidScheduleTypes ()
 Returns a collection of all valid schedule types for a specific job. More...
 
 isManuallyExecutable ()
 
 hasCustomSettings ()
 
 addCustomSettingsToForm (ilPropertyFormGUI $a_form)
 
 saveCustomSettings (ilPropertyFormGUI $a_form)
 
 addToExternalSettingsForm (int $a_form_id, array &$a_fields, bool $a_is_active)
 
 activationWasToggled (ilDBInterface $db, ilSetting $setting, bool $a_currently_active)
 Important: This method is (also) called from the setup process, where the constructor of an ilCronJob ist NOT executed. More...
 
 getId ()
 
 getTitle ()
 
 getDescription ()
 
 hasAutoActivation ()
 Is to be activated on "installation", does only work for ILIAS core cron jobs. More...
 
 hasFlexibleSchedule ()
 
 getDefaultScheduleType ()
 
 getDefaultScheduleValue ()
 
 run ()
 

Protected Attributes

ilLanguage $lng
 
- Protected Attributes inherited from ilCronJob
CronJobScheduleType $schedule_type = null
 
int $schedule_value = null
 
Closure $date_time_provider = null
 

Detailed Description

Cron for exercise reminders.

Author
Jesús López lopez.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 27 of file class.ilExcCronReminders.php.

Constructor & Destructor Documentation

◆ __construct()

ilExcCronReminders::__construct ( )

Definition at line 31 of file class.ilExcCronReminders.php.

References $DIC, and ILIAS\Repository\lng().

32  {
33  global $DIC;
34 
35  $this->lng = $DIC->language();
36  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ getDefaultScheduleType()

ilExcCronReminders::getDefaultScheduleType ( )

Definition at line 61 of file class.ilExcCronReminders.php.

62  {
63  return CronJobScheduleType::SCHEDULE_TYPE_DAILY;
64  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getDefaultScheduleValue()

ilExcCronReminders::getDefaultScheduleValue ( )

Definition at line 66 of file class.ilExcCronReminders.php.

66  : ?int
67  {
68  return null;
69  }

◆ getDescription()

ilExcCronReminders::getDescription ( )

Definition at line 52 of file class.ilExcCronReminders.php.

References $lng, ilLanguage\loadLanguageModule(), and ilLanguage\txt().

52  : string
53  {
54  $lng = $this->lng;
55 
56  $lng->loadLanguageModule("exc");
57 
58  return $lng->txt("exc_reminders_cron_info");
59  }
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...
loadLanguageModule(string $a_module)
Load language module.
+ Here is the call graph for this function:

◆ getId()

ilExcCronReminders::getId ( )

Definition at line 38 of file class.ilExcCronReminders.php.

38  : string
39  {
40  return "exc_reminders";
41  }

◆ getTitle()

ilExcCronReminders::getTitle ( )

Definition at line 43 of file class.ilExcCronReminders.php.

References $lng, ilLanguage\loadLanguageModule(), and ilLanguage\txt().

43  : string
44  {
45  $lng = $this->lng;
46 
47  $lng->loadLanguageModule("exc");
48 
49  return $lng->txt("exc_reminders_cron");
50  }
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...
loadLanguageModule(string $a_module)
Load language module.
+ Here is the call graph for this function:

◆ hasAutoActivation()

ilExcCronReminders::hasAutoActivation ( )

Definition at line 71 of file class.ilExcCronReminders.php.

71  : bool
72  {
73  return true;
74  }

◆ hasFlexibleSchedule()

ilExcCronReminders::hasFlexibleSchedule ( )

Definition at line 76 of file class.ilExcCronReminders.php.

76  : bool
77  {
78  return true;
79  }

◆ run()

ilExcCronReminders::run ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 84 of file class.ilExcCronReminders.php.

References $log, $message, ilLoggerFactory\getLogger(), ILIAS\Repository\lng(), ilCronJobResult\STATUS_NO_ACTION, and ilCronJobResult\STATUS_OK.

85  {
87  $log->debug("--- Start Exercise Reminders Cron");
88 
89  $cron_status = ilCronJobResult::STATUS_NO_ACTION;
90  $message = "";
91  $reminder = new ilExAssignmentReminder();
92  $num_reminders = $reminder->checkReminders();
93 
94  $this->lng->loadLanguageModule("exc");
95 
96  if ($num_reminders !== 0) {
97  $cron_status = ilCronJobResult::STATUS_OK;
98  $message = $this->lng->txt('exc_reminder_cron_ok');
99  }
100 
101  $cron_result = new ilCronJobResult();
102  $cron_result->setStatus($cron_status);
103 
104  if ($message != "") {
105  $cron_result->setMessage($message . " " . $num_reminders . ' / ' . "#" . $num_reminders);
106  }
107 
108  return $cron_result;
109  }
static getLogger(string $a_component_id)
Get component logger.
$log
Definition: result.php:33
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
final const STATUS_NO_ACTION
$message
Definition: xapiexit.php:32
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilExcCronReminders::$lng
protected

Definition at line 29 of file class.ilExcCronReminders.php.

Referenced by getDescription(), and getTitle().


The documentation for this class was generated from the following file: