ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilLTICronOutcomeService.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
25
33{
36
37 public function __construct()
38 {
39 global $DIC;
40 $this->lng = $DIC->language();
41 $this->lng->loadLanguageModule("lti");
42 $this->cronRepo = $DIC->cron()->repository();
43 }
44
46 {
47 return JobScheduleType::DAILY;
48 }
49
50 public function getDefaultScheduleValue(): ?int
51 {
52 return 1;
53 }
54
55 public function getId(): string
56 {
57 return 'lti_outcome';
58 }
59
60 public function hasAutoActivation(): bool
61 {
62 return false;
63 }
64
65 public function hasFlexibleSchedule(): bool
66 {
67 return true;
68 }
69
70 public function getTitle(): string
71 {
72 return $this->lng->txt('lti_cron_title');
73 }
74
75 public function getDescription(): string
76 {
77 return $this->lng->txt('lti_cron_title_desc');
78 }
79
80 public function run(): JobResult
81 {
83
84 $info = $this->cronRepo->getCronJobData($this->getId());
85 $last_ts = $info['job_status_ts'] ?? false;
86 if (!$last_ts) {
87 $last_ts = time() - 24 * 3600;
88 }
89 $since = new ilDateTime($last_ts, IL_CAL_UNIX);
90
91
92 $result = new \ILIAS\Cron\Job\JobResult();
93 $result->setStatus($status);
95 $result->setStatus(JobResult::STATUS_OK);
96
97 return $result;
98 }
99}
final const int STATUS_NO_ACTION
Definition: JobResult.php:26
const IL_CAL_UNIX
@classDescription Date and time handling
static handleCronUpdate(ilDateTime $since)
hasAutoActivation()
Is to be activated on "installation", does only work for ILIAS core cron jobs.
language handling
$info
Definition: entry_point.php:21
global $DIC
Definition: shib_login.php:26