ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilLTICronOutcomeService.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
22 
30 {
31  private ilLanguage $lng;
33 
34  public function __construct()
35  {
36  global $DIC;
37  $this->lng = $DIC->language();
38  $this->lng->loadLanguageModule("lti");
39  $this->cronRepo = $DIC->cron()->repository();
40  }
41 
43  {
44  return CronJobScheduleType::SCHEDULE_TYPE_DAILY;
45  }
46 
47  public function getDefaultScheduleValue(): ?int
48  {
49  return 1;
50  }
51 
52  public function getId(): string
53  {
54  return 'lti_outcome';
55  }
56 
57  public function hasAutoActivation(): bool
58  {
59  return false;
60  }
61 
62  public function hasFlexibleSchedule(): bool
63  {
64  return true;
65  }
66 
67  public function getTitle(): string
68  {
69  return $this->lng->txt('lti_cron_title');
70  }
71 
72  public function getDescription(): string
73  {
74  return $this->lng->txt('lti_cron_title_desc');
75  }
76 
77  public function run(): ilCronJobResult
78  {
80 
81  $info = $this->cronRepo->getCronJobData($this->getId());
82  $last_ts = $info['job_status_ts'] ?? false;
83  if (!$last_ts) {
84  $last_ts = time() - 24 * 3600;
85  }
86  $since = new ilDateTime($last_ts, IL_CAL_UNIX);
87 
88 
89  $result = new \ilCronJobResult();
90  $result->setStatus($status);
92  $result->setStatus(ilCronJobResult::STATUS_OK);
93 
94  return $result;
95  }
96 }
static handleCronUpdate(ilDateTime $since)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_CAL_UNIX
global $DIC
Definition: feed.php:28
Description of class class.
final const STATUS_NO_ACTION