ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilPrgUpdateProgressCronJob.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2019 Daniel Weise <daniel.weise@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4
5declare(strict_types=1);
6
8{
9 const ID = 'prg_update_progress';
10
15
19 protected $log;
20
24 protected $lng;
25
26 public function __construct()
27 {
28 global $DIC;
29
30 $this->user_progress_db = ilStudyProgrammeDIC::dic()['ilStudyProgrammeUserProgressDB'];
31 $this->log = $DIC['ilLog'];
32 $this->lng = $DIC['lng'];
33 $this->lng->loadLanguageModule('prg');
34 }
35
36 public function getTitle()
37 {
38 return $this->lng->txt('prg_update_progress_title');
39 }
40
41 public function getDescription()
42 {
43 return $this->lng->txt('prg_update_progress_description');
44 }
45
46 public function getId()
47 {
48 return self::ID;
49 }
50
51 public function hasAutoActivation()
52 {
53 return true;
54 }
55
56 public function hasFlexibleSchedule()
57 {
58 return true;
59 }
60
61 public function getDefaultScheduleType()
62 {
64 }
65
66 public function getDefaultScheduleValue()
67 {
68 return 1;
69 }
70
71 public function run()
72 {
74 foreach ($this->user_progress_db->getPassedDeadline() as $progress) {
75 if ($progress->getStatus() === ilStudyProgrammeProgress::STATUS_IN_PROGRESS) {
76 $progress->markFailed($progress->getUserId());
77 }
78 }
80
81 return $result;
82 }
83}
$result
An exception for terminatinating execution or to throw for unit testing.
Cron job result data container.
Cron job application base class.
const SCHEDULE_TYPE_IN_DAYS
hasAutoActivation()
Is to be activated on "installation".
hasFlexibleSchedule()
Can the schedule be configured?
$DIC
Definition: xapitoken.php:46