ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilCmiXapiDateDurationInputGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
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}
$duration
const IL_CAL_UNIX
static fromIliasDateTime(ilDateTime $dateTime)
input GUI for a time span (start and end date)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
@classDescription Date and time handling