ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilCmiXapiDateDurationInputGUI.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
31 {
32  public function getValue(): array
33  {
34  $duration = array();
35 
36  if ($this->getStart() instanceof ilDateTime) {
37  $duration['start'] = $this->getStart()->get(IL_CAL_UNIX);
38  }
39 
40  if ($this->getEnd() instanceof ilDateTime) {
41  $duration['end'] = $this->getEnd()->get(IL_CAL_UNIX);
42  }
43 
44  return $duration;
45  }
46 
51  {
52  $xapiDateTime = null;
53  if ($this->getStart() instanceof ilDateTime) {
54  try {
55  $xapiDateTime = ilCmiXapiDateTime::fromIliasDateTime($this->getStart());
56  } catch (ilDateTimeException $e) {
57  return null;
58  }
59  }
60  return $xapiDateTime;
61  }
62 
67  {
68  $xapiDateTime = null;
69  if ($this->getEnd() instanceof ilDateTime) {
70  try {
71  $xapiDateTime = ilCmiXapiDateTime::fromIliasDateTime($this->getEnd());
72  } catch (ilDateTimeException $e) {
73  return null;
74  }
75  }
76  return $xapiDateTime;
77  }
78 }
const IL_CAL_UNIX
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static fromIliasDateTime(ilDateTime $dateTime)