1<?php
2
3namespace Sabre\DAV\Xml\Property;
4
5use Sabre\Xml\Writer;
6use Sabre\Xml\XmlSerializable;
7
8/**
9 * This class represents the {DAV:}supportedlock property.
10 *
11 * This property is defined here:
12 * http://tools.ietf.org/html/rfc4918#section-15.10
13 *
14 * This property contains information about what kind of locks
15 * this server supports.
16 *
17 * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
18 * @author Evert Pot (http://www.rooftopsolutions.nl/)
19 * @license http://sabre.io/license/ Modified BSD License
20 */
21class SupportedLock implements XmlSerializable {
22
23    /**
24     * The xmlSerialize method is called during xml writing.
25     *
26     * Use the $writer argument to write its own xml serialization.
27     *
28     * An important note: do _not_ create a parent element. Any element
29     * implementing XmlSerializable should only ever write what's considered
30     * its 'inner xml'.
31     *
32     * The parent of the current element is responsible for writing a
33     * containing element.
34     *
35     * This allows serializers to be re-used for different element names.
36     *
37     * If you are opening new elements, you must also close them again.
38     *
39     * @param Writer $writer
40     * @return void
41     */
42    function xmlSerialize(Writer $writer) {
43
44        $writer->writeElement('{DAV:}lockentry', [
45            '{DAV:}lockscope' => ['{DAV:}exclusive' => null],
46            '{DAV:}locktype'  => ['{DAV:}write' => null],
47        ]);
48        $writer->writeElement('{DAV:}lockentry', [
49            '{DAV:}lockscope' => ['{DAV:}shared' => null],
50            '{DAV:}locktype'  => ['{DAV:}write' => null],
51        ]);
52
53    }
54}
55