ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
AddressBookMultiGetReport.php
Go to the documentation of this file.
1 <?php
2 
4 
6 use Sabre\Uri;
9 
23 
29  public $properties;
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 }
parseInnerTree(array $elementMap=null)
Parses all elements below the current element.
Definition: Reader.php:129
resolve($basePath, $newPath)
This file contains all the uri handling functions.
Definition: functions.php:23
const NS_CARDDAV
xml namespace for CardDAV elements
Definition: Plugin.php:33
The Reader class expands upon PHP&#39;s built-in XMLReader.
Definition: Reader.php:20
Implementing the XmlDeserializable interface allows you to use a class as a deserializer for a specif...
$key
Definition: croninfo.php:18
static xmlDeserialize(Reader $reader)
The deserialize method is called during xml parsing.