ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SyncCollectionReport.php
Go to the documentation of this file.
1<?php
2
4
9
22
28 public $syncToken;
29
35 public $syncLevel;
36
42 public $limit;
43
50
72 static function xmlDeserialize(Reader $reader) {
73
74 $self = new self();
75
76 $reader->pushContext();
77
78 $reader->elementMap['{DAV:}prop'] = 'Sabre\Xml\Element\Elements';
80
81 $reader->popContext();
82
83 $required = [
84 '{DAV:}sync-token',
85 '{DAV:}prop',
86 ];
87
88 foreach ($required as $elem) {
89 if (!array_key_exists($elem, $elems)) {
90 throw new BadRequest('The ' . $elem . ' element in the {DAV:}sync-collection report is required');
91 }
92 }
93
94
95 $self->properties = $elems['{DAV:}prop'];
96 $self->syncToken = $elems['{DAV:}sync-token'];
97
98 if (isset($elems['{DAV:}limit'])) {
99 $nresults = null;
100 foreach ($elems['{DAV:}limit'] as $child) {
101 if ($child['name'] === '{DAV:}nresults') {
102 $nresults = (int)$child['value'];
103 }
104 }
105 $self->limit = $nresults;
106 }
107
108 if (isset($elems['{DAV:}sync-level'])) {
109
110 $value = $elems['{DAV:}sync-level'];
111 if ($value === 'infinity') {
113 }
114 $self->syncLevel = $value;
115
116 }
117
118 return $self;
119
120 }
121
122}
An exception for terminatinating execution or to throw for unit testing.
const DEPTH_INFINITY
Infinity is used for some request supporting the HTTP Depth header and indicates that the operation s...
Definition: Server.php:30
static xmlDeserialize(Reader $reader)
The deserialize method is called during xml parsing.
'KeyValue' parses out all child elements from a single node, and outputs a key=>value struct.
Definition: KeyValue.php:36
static xmlDeserialize(Xml\Reader $reader)
The deserialize method is called during xml parsing.
Definition: KeyValue.php:102
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...