ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
FreeBusyQueryReport.php
Go to the documentation of this file.
1<?php
2
4
10
23
29 public $start;
30
36 public $end;
37
59 static function xmlDeserialize(Reader $reader) {
60
61 $timeRange = '{' . Plugin::NS_CALDAV . '}time-range';
62
63 $start = null;
64 $end = null;
65
66 foreach ((array)$reader->parseInnerTree([]) as $elem) {
67
68 if ($elem['name'] !== $timeRange) continue;
69
70 $start = empty($elem['attributes']['start']) ?: $elem['attributes']['start'];
71 $end = empty($elem['attributes']['end']) ?: $elem['attributes']['end'];
72
73 }
74 if (!$start && !$end) {
75 throw new BadRequest('The freebusy report must have a time-range element');
76 }
77 if ($start) {
79 }
80 if ($end) {
82 }
83 $result = new self();
84 $result->start = $start;
85 $result->end = $end;
86
87 return $result;
88
89 }
90
91}
$result
An exception for terminatinating execution or to throw for unit testing.
CalDAV plugin.
Definition: Plugin.php:28
const NS_CALDAV
This is the official CalDAV namespace.
Definition: Plugin.php:33
static xmlDeserialize(Reader $reader)
The deserialize method is called during xml parsing.
static parseDateTime($dt, DateTimeZone $tz=null)
Parses an iCalendar (rfc5545) formatted datetime and returns a DateTimeImmutable object.
The Reader class expands upon PHP's built-in XMLReader.
Definition: Reader.php:20
Implementing the XmlDeserializable interface allows you to use a class as a deserializer for a specif...