ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SupportedAddressData.php
Go to the documentation of this file.
1 <?php
2 
4 
8 
24 
30  protected $supportedData = [];
31 
37  function __construct(array $supportedData = null) {
38 
39  if (is_null($supportedData)) {
40  $supportedData = [
41  ['contentType' => 'text/vcard', 'version' => '3.0'],
42  ['contentType' => 'text/vcard', 'version' => '4.0'],
43  ['contentType' => 'application/vcard+json', 'version' => '4.0'],
44  ];
45  }
46 
47  $this->supportedData = $supportedData;
48 
49  }
50 
70  function xmlSerialize(Writer $writer) {
71 
72  foreach ($this->supportedData as $supported) {
73  $writer->startElement('{' . Plugin::NS_CARDDAV . '}address-data-type');
74  $writer->writeAttributes([
75  'content-type' => $supported['contentType'],
76  'version' => $supported['version']
77  ]);
78  $writer->endElement(); // address-data-type
79  }
80 
81  }
82 
83 }
Objects implementing XmlSerializable can control how they are represented in Xml. ...
iCalendar/vCard/jCal/jCard/xCal/xCard writer object.
Definition: Writer.php:17
const NS_CARDDAV
xml namespace for CardDAV elements
Definition: Plugin.php:33
__construct(array $supportedData=null)
Creates the property.
xmlSerialize(Writer $writer)
The xmlSerialize method is called during xml writing.