ILIAS  release_7 Revision v7.30-3-g800a261c036
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
12{
13 const ID = 'prg_update_progress';
14
18 protected $dic;
19
23 protected $lng;
24
25 public function __construct()
26 {
27 global $DIC;
28
29 $this->lng = $DIC['lng'];
30 $this->lng->loadLanguageModule('prg');
31 $this->dic = ilStudyProgrammeDIC::dic();
32 }
33
34 public function getTitle()
35 {
36 return $this->lng->txt('prg_update_progress_title');
37 }
38
39 public function getDescription()
40 {
41 return $this->lng->txt('prg_update_progress_description');
42 }
43
44 public function getId()
45 {
46 return self::ID;
47 }
48
49 public function hasAutoActivation()
50 {
51 return true;
52 }
53
54 public function hasFlexibleSchedule()
55 {
56 return true;
57 }
58
59 public function getDefaultScheduleType()
60 {
62 }
63
64 public function getDefaultScheduleValue()
65 {
66 return 1;
67 }
68
69 public function run()
70 {
73 $acting_user = $this->getActingUserId();
74 foreach ($this->getProgressRepository()->getPassedDeadline() as $progress) {
75 if ($progress->getStatus() === ilStudyProgrammeProgress::STATUS_IN_PROGRESS) {
76 $programme = ilObjStudyProgramme::getInstanceByObjId($progress->getNodeId());
77 $programme->markFailed($progress->getId(), $acting_user);
79 }
80 }
81 return $result;
82 }
83
85 {
86 return $this->dic['ilStudyProgrammeUserProgressDB'];
87 }
88 protected function getActingUserId() : int
89 {
90 return $this->dic['current_user']->getId();
91 }
92}
$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
This will set progresses to FAILED, if they are past the deadline (and not successful,...
hasAutoActivation()
Is to be activated on "installation".
hasFlexibleSchedule()
Can the schedule be configured?
global $DIC
Definition: goto.php:24