ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilLTICronOutcomeService.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
28 {
29  private ilLanguage $lng;
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  {
42  return self::SCHEDULE_TYPE_DAILY;
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 }
static handleCronUpdate(ilDateTime $since)
const IL_CAL_UNIX
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...