ILIAS  release_8 Revision v8.24
class.ilLTICronOutcomeService.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
28{
31
32 public function __construct()
33 {
34 global $DIC;
35 $this->lng = $DIC->language();
36 $this->lng->loadLanguageModule("lti");
37 $this->cronRepo = $DIC->cron()->repository();
38 }
39
40 public function getDefaultScheduleType(): int
41 {
43 }
44
45 public function getDefaultScheduleValue(): ?int
46 {
47 return 1;
48 }
49
50 public function getId(): string
51 {
52 return 'lti_outcome';
53 }
54
55 public function hasAutoActivation(): bool
56 {
57 return false;
58 }
59
60 public function hasFlexibleSchedule(): bool
61 {
62 return true;
63 }
64
65 public function getTitle(): string
66 {
67 return $this->lng->txt('lti_cron_title');
68 }
69
70 public function getDescription(): string
71 {
72 return $this->lng->txt('lti_cron_title_desc');
73 }
74
75 public function run(): ilCronJobResult
76 {
78
79 $info = $this->cronRepo->getCronJobData($this->getId());
80 $last_ts = $info['job_status_ts'] ?? false;
81 if (!$last_ts) {
82 $last_ts = time() - 24 * 3600;
83 }
84 $since = new ilDateTime($last_ts, IL_CAL_UNIX);
85
86
87 $result = new \ilCronJobResult();
88 $result->setStatus($status);
90 $result->setStatus(ilCronJobResult::STATUS_OK);
91
92 return $result;
93 }
94}
const IL_CAL_UNIX
const SCHEDULE_TYPE_DAILY
@depracated This will be replaced with an ENUM in ILIAS 9
@classDescription Date and time handling
static handleCronUpdate(ilDateTime $since)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
hasAutoActivation()
Is to be activated on "installation", does only work for ILIAS core cron jobs.
language handling
global $DIC
Definition: feed.php:28