ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilLTICronOutcomeService.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
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 
80  public function run(): ilCronJobResult
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 \ilCronJobResult();
93  $result->setStatus($status);
95  $result->setStatus(ilCronJobResult::STATUS_OK);
96 
97  return $result;
98  }
99 }
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
Description of class class.
final const STATUS_NO_ACTION
global $DIC
Definition: shib_login.php:25