ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPrgInvalidateExpiredProgressesCronJob Class Reference

This ivalidates a successful progress if validityOfQualification is reached. More...

+ Inheritance diagram for ilPrgInvalidateExpiredProgressesCronJob:
+ Collaboration diagram for ilPrgInvalidateExpiredProgressesCronJob:

Public Member Functions

 __construct ()
 
 getTitle ()
 Get title. More...
 
 getDescription ()
 Get description. More...
 
 getId ()
 Get id. More...
 
 hasAutoActivation ()
 Is to be activated on "installation". More...
 
 hasFlexibleSchedule ()
 Can the schedule be configured? More...
 
 getDefaultScheduleType ()
 Get schedule type. More...
 
 getDefaultScheduleValue ()
 Get schedule value. More...
 
 run ()
 Run job. More...
 
- Public Member Functions inherited from ilCronJob
 isActive ($a_ts_last_run, $a_schedule_type, $a_schedule_value, $a_manual=false)
 Is job currently active? More...
 
 getScheduleType ()
 Get current schedule type (if flexible) More...
 
 getScheduleValue ()
 Get current schedule value (if flexible) More...
 
 setSchedule ($a_type, $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...
 
 getTitle ()
 Get title. More...
 
 getDescription ()
 Get description. More...
 
 isManuallyExecutable ()
 Defines whether or not a cron job can be started manually. More...
 
 hasCustomSettings ()
 Has cron job any custom setting which can be edited? More...
 
 addCustomSettingsToForm (ilPropertyFormGUI $a_form)
 Add custom settings to form. More...
 
 saveCustomSettings (ilPropertyFormGUI $a_form)
 Save custom settings. More...
 
 addToExternalSettingsForm ($a_form_id, array &$a_fields, $a_is_active)
 Add external settings to form. More...
 
 activationWasToggled ($a_currently_active)
 Cron job status was changed. More...
 
 getId ()
 Get id. More...
 
 hasAutoActivation ()
 Is to be activated on "installation". More...
 
 hasFlexibleSchedule ()
 Can the schedule be configured? More...
 
 getDefaultScheduleType ()
 Get schedule type. More...
 
 getDefaultScheduleValue ()
 Get schedule value. More...
 
 run ()
 Run job. More...
 

Data Fields

const ID = 'prg_invalidate_expired_progresses'
 
- Data Fields inherited from ilCronJob
const SCHEDULE_TYPE_DAILY = 1
 
const SCHEDULE_TYPE_IN_MINUTES = 2
 
const SCHEDULE_TYPE_IN_HOURS = 3
 
const SCHEDULE_TYPE_IN_DAYS = 4
 
const SCHEDULE_TYPE_WEEKLY = 5
 
const SCHEDULE_TYPE_MONTHLY = 6
 
const SCHEDULE_TYPE_QUARTERLY = 7
 
const SCHEDULE_TYPE_YEARLY = 8
 

Protected Attributes

 $user_progress_db
 
 $log
 
 $lng
 

Additional Inherited Members

- Protected Member Functions inherited from ilCronJob
 checkSchedule ($a_ts_last_run, $a_schedule_type, $a_schedule_value)
 

Detailed Description

This ivalidates a successful progress if validityOfQualification is reached.

This is deprecated, I think. It is perfectly feasible to raise some event for this, though, but invalidation is reached by a date rather than a flag set by a cron job.

Definition at line 15 of file class.ilPrgInvalidateExpiredProgressesCronJob.php.

Constructor & Destructor Documentation

◆ __construct()

ilPrgInvalidateExpiredProgressesCronJob::__construct ( )

Definition at line 34 of file class.ilPrgInvalidateExpiredProgressesCronJob.php.

References $DIC, and ilStudyProgrammeDIC\dic().

35  {
36  global $DIC;
37 
38  $this->user_progress_db = ilStudyProgrammeDIC::dic()['model.Progress.ilStudyProgrammeProgressRepository'];
39  $this->log = $DIC['ilLog'];
40  $this->lng = $DIC['lng'];
41  $this->lng->loadLanguageModule('prg');
42  }
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

Member Function Documentation

◆ getDefaultScheduleType()

ilPrgInvalidateExpiredProgressesCronJob::getDefaultScheduleType ( )

Get schedule type.

Returns
int

Definition at line 99 of file class.ilPrgInvalidateExpiredProgressesCronJob.php.

100  {
101  return self::SCHEDULE_TYPE_IN_DAYS;
102  }

◆ getDefaultScheduleValue()

ilPrgInvalidateExpiredProgressesCronJob::getDefaultScheduleValue ( )

Get schedule value.

Returns
int|array

Definition at line 109 of file class.ilPrgInvalidateExpiredProgressesCronJob.php.

110  {
111  return 1;
112  }

◆ getDescription()

ilPrgInvalidateExpiredProgressesCronJob::getDescription ( )

Get description.

Returns
string

Definition at line 59 of file class.ilPrgInvalidateExpiredProgressesCronJob.php.

60  {
61  return $this->lng->txt('prg_invalidate_expired_progresses_desc');
62  }

◆ getId()

ilPrgInvalidateExpiredProgressesCronJob::getId ( )

Get id.

Returns
string

Definition at line 69 of file class.ilPrgInvalidateExpiredProgressesCronJob.php.

70  {
71  return self::ID;
72  }

◆ getTitle()

ilPrgInvalidateExpiredProgressesCronJob::getTitle ( )

Get title.

Returns
string

Definition at line 49 of file class.ilPrgInvalidateExpiredProgressesCronJob.php.

50  {
51  return $this->lng->txt('prg_invalidate_expired_progresses_title');
52  }

◆ hasAutoActivation()

ilPrgInvalidateExpiredProgressesCronJob::hasAutoActivation ( )

Is to be activated on "installation".

Returns
boolean

Definition at line 79 of file class.ilPrgInvalidateExpiredProgressesCronJob.php.

80  {
81  return true;
82  }

◆ hasFlexibleSchedule()

ilPrgInvalidateExpiredProgressesCronJob::hasFlexibleSchedule ( )

Can the schedule be configured?

Returns
boolean

Definition at line 89 of file class.ilPrgInvalidateExpiredProgressesCronJob.php.

90  {
91  return true;
92  }

◆ run()

ilPrgInvalidateExpiredProgressesCronJob::run ( )

Run job.

Returns
ilCronJobResult

Definition at line 119 of file class.ilPrgInvalidateExpiredProgressesCronJob.php.

References Vendor\Package\$e, $result, and ilCronJobResult\STATUS_OK.

120  {
121  $result = new ilCronJobResult();
122  foreach ($this->user_progress_db->getExpiredSuccessfull() as $progress) {
123  try {
124  $progress->invalidate();
125  } catch (ilException $e) {
126  $this->log->write('an error occured: ' . $e->getMessage());
127  }
128  }
130  return $result;
131  }
$result
Cron job result data container.

Field Documentation

◆ $lng

ilPrgInvalidateExpiredProgressesCronJob::$lng
protected

◆ $log

ilPrgInvalidateExpiredProgressesCronJob::$log
protected

◆ $user_progress_db

ilPrgInvalidateExpiredProgressesCronJob::$user_progress_db
protected

◆ ID

const ilPrgInvalidateExpiredProgressesCronJob::ID = 'prg_invalidate_expired_progresses'

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