ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
KeyValue.php
Go to the documentation of this file.
1 <?php
2 
4 
5 use Sabre\Xml as SabreXml;
6 
16 class KeyValue extends SabreXml\Element\KeyValue {
17 
41 
42  // If there's no children, we don't do anything.
43  if ($reader->isEmptyElement) {
44  $reader->next();
45  return [];
46  }
47 
48  $values = [];
49  $reader->read();
50 
51  do {
52 
53  if ($reader->nodeType === SabreXml\Reader::ELEMENT) {
54 
55  $name = $reader->localName;
56  $values[$name] = $reader->parseCurrentElement()['value'];
57 
58  } else {
59  $reader->read();
60  }
61 
62  } while ($reader->nodeType !== SabreXml\Reader::END_ELEMENT);
63 
64  $reader->read();
65 
66  return $values;
67 
68  }
69 
70 }
Our own sabre/xml key-value element.
Definition: KeyValue.php:16
static xmlDeserialize(SabreXml\Reader $reader)
The deserialize method is called during xml parsing.
Definition: KeyValue.php:40
$values
iCalendar/vCard/jCal/jCard/xCal/xCard reader object.
Definition: Reader.php:15