ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
AddressBookMultiGetReport.php
Go to the documentation of this file.
1<?php
2
4
6use Sabre\Uri;
9
23
30
36 public $hrefs;
37
44 public $contentType = null;
45
52 public $version = null;
53
75 static function xmlDeserialize(Reader $reader) {
76
77 $elems = $reader->parseInnerTree([
78 '{urn:ietf:params:xml:ns:carddav}address-data' => 'Sabre\\CardDAV\\Xml\\Filter\\AddressData',
79 '{DAV:}prop' => 'Sabre\\Xml\\Element\\KeyValue',
80 ]);
81
82 $newProps = [
83 'hrefs' => [],
84 'properties' => []
85 ];
86
87 foreach ($elems as $elem) {
88
89 switch ($elem['name']) {
90
91 case '{DAV:}prop' :
92 $newProps['properties'] = array_keys($elem['value']);
93 if (isset($elem['value']['{' . Plugin::NS_CARDDAV . '}address-data'])) {
94 $newProps += $elem['value']['{' . Plugin::NS_CARDDAV . '}address-data'];
95 }
96 break;
97 case '{DAV:}href' :
98 $newProps['hrefs'][] = Uri\resolve($reader->contextUri, $elem['value']);
99 break;
100
101 }
102
103 }
104
105 $obj = new self();
106 foreach ($newProps as $key => $value) {
107 $obj->$key = $value;
108 }
109 return $obj;
110
111 }
112
113}
An exception for terminatinating execution or to throw for unit testing.
CardDAV plugin.
Definition: Plugin.php:23
const NS_CARDDAV
xml namespace for CardDAV elements
Definition: Plugin.php:33
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
$key
Definition: croninfo.php:18
Implementing the XmlDeserializable interface allows you to use a class as a deserializer for a specif...
resolve($basePath, $newPath)
This file contains all the uri handling functions.
Definition: functions.php:23