1<?php
2
3namespace Sabre\CardDAV\Xml\Property;
4
5use Sabre\Xml\Writer;
6use Sabre\Xml\XmlSerializable;
7
8/**
9 * supported-collation-set property
10 *
11 * This property is a representation of the supported-collation-set property
12 * in the CardDAV namespace.
13 *
14 * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
15 * @author Evert Pot (http://evertpot.com/)
16 * @license http://sabre.io/license/ Modified BSD License
17 */
18class SupportedCollationSet implements XmlSerializable {
19
20    /**
21     * The xmlSerialize method is called during xml writing.
22     *
23     * Use the $writer argument to write its own xml serialization.
24     *
25     * An important note: do _not_ create a parent element. Any element
26     * implementing XmlSerializable should only ever write what's considered
27     * its 'inner xml'.
28     *
29     * The parent of the current element is responsible for writing a
30     * containing element.
31     *
32     * This allows serializers to be re-used for different element names.
33     *
34     * If you are opening new elements, you must also close them again.
35     *
36     * @param Writer $writer
37     * @return void
38     */
39    function xmlSerialize(Writer $writer) {
40
41        foreach (['i;ascii-casemap', 'i;octet', 'i;unicode-casemap'] as $coll) {
42            $writer->writeElement('{urn:ietf:params:xml:ns:carddav}supported-collation', $coll);
43        }
44
45    }
46
47}
48