ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ExpandPropertyReport.php
Go to the documentation of this file.
1<?php
2
4
7
20
34
56 static function xmlDeserialize(Reader $reader) {
57
58 $elems = $reader->parseInnerTree();
59
60 $obj = new self();
61 $obj->properties = self::traverse($elems);
62
63 return $obj;
64
65 }
66
74 private static function traverse($elems) {
75
76 $result = [];
77
78 foreach ($elems as $elem) {
79
80 if ($elem['name'] !== '{DAV:}property') {
81 continue;
82 }
83
84 $namespace = isset($elem['attributes']['namespace']) ?
85 $elem['attributes']['namespace'] :
86 'DAV:';
87
88 $propName = '{' . $namespace . '}' . $elem['attributes']['name'];
89
90 $value = null;
91 if (is_array($elem['value'])) {
92 $value = self::traverse($elem['value']);
93 }
94
95 $result[$propName] = $value;
96
97 }
98
99 return $result;
100
101 }
102
103}
$result
An exception for terminatinating execution or to throw for unit testing.
static traverse($elems)
This method is used by deserializeXml, to recursively parse the {DAV:}property elements.
static xmlDeserialize(Reader $reader)
The deserialize method is called during xml parsing.
The Reader class expands upon PHP's built-in XMLReader.
Definition: Reader.php:20
if($err=$client->getError()) $namespace
Implementing the XmlDeserializable interface allows you to use a class as a deserializer for a specif...