49 public function __construct(
int $startDateTime,
int $endDateTime)
72 $timePeriod = new \stdClass();
73 if (!is_null($this->startDateTime)) {
74 $timePeriod->startDateTime = gmdate(
'Y-m-d\TH:i:s\Z', $this->startDateTime);
76 if (!is_null($this->endDateTime)) {
77 $timePeriod->endDateTime = gmdate(
'Y-m-d\TH:i:s\Z', $this->endDateTime);
91 $startDateTime = null;
93 if (is_object($item)) {
95 foreach (get_object_vars($item) as
$name => $value) {
98 $startDateTime = strtotime($item->startDateTime);
101 $endDateTime = strtotime($item->endDateTime);
108 if ($startDateTime || $endDateTime) {
109 $obj =
new TimePeriod($startDateTime, $endDateTime);
Class to represent a time period object.
int $endDateTime
End date/time.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
toJsonldObject()
Generate the JSON-LD object representation of the time period.
static fromJsonObject(object $item)
Generate a LineItem object from its JSON or JSON-LD representation.
toJsonObject()
Generate the JSON object representation of the image.
int $startDateTime
Start date/time.
__construct(int $startDateTime, int $endDateTime)
Class constructor.