1<?php
2
3namespace SabreForRainLoop\DAV\Exception;
4
5use SabreForRainLoop\DAV;
6
7/**
8 * ConflictingLock
9 *
10 * Similar to  the Locked exception, this exception thrown when a LOCK request
11 * was made, on a resource which was already locked
12 *
13 * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/).
14 * @author Evert Pot (http://evertpot.com/)
15 * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
16 */
17class ConflictingLock extends Locked {
18
19    /**
20     * This method allows the exception to include additional information into the WebDAV error response
21     *
22     * @param DAV\Server $server
23     * @param \DOMElement $errorNode
24     * @return void
25     */
26    public function serialize(DAV\Server $server, \DOMElement $errorNode) {
27
28        if ($this->lock) {
29            $error = $errorNode->ownerDocument->createElementNS('DAV:','d:no-conflicting-lock');
30            $errorNode->appendChild($error);
31            if (!is_object($this->lock)) var_dump($this->lock);
32            $error->appendChild($errorNode->ownerDocument->createElementNS('DAV:','d:href',$this->lock->uri));
33        }
34
35    }
36
37}
38