ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Locked.php
Go to the documentation of this file.
1<?php
2
3namespace Sabre\DAV\Exception;
4
5use Sabre\DAV;
6
16class Locked extends DAV\Exception {
17
23 protected $lock;
24
33 function __construct(DAV\Locks\LockInfo $lock = null) {
34
35 $this->lock = $lock;
36
37 }
38
44 function getHTTPCode() {
45
46 return 423;
47
48 }
49
57 function serialize(DAV\Server $server, \DOMElement $errorNode) {
58
59 if ($this->lock) {
60 $error = $errorNode->ownerDocument->createElementNS('DAV:', 'd:lock-token-submitted');
61 $errorNode->appendChild($error);
62
63 $href = $errorNode->ownerDocument->createElementNS('DAV:', 'd:href');
64 $href->appendChild($errorNode->ownerDocument->createTextNode($this->lock->uri));
65 $error->appendChild(
66 $href
67 );
68 }
69
70 }
71
72}
An exception for terminatinating execution or to throw for unit testing.
getHTTPCode()
Returns the HTTP statuscode for this exception.
Definition: Locked.php:44
__construct(DAV\Locks\LockInfo $lock=null)
Creates the exception.
Definition: Locked.php:33
serialize(DAV\Server $server, \DOMElement $errorNode)
This method allows the exception to include additional information into the WebDAV error response.
Definition: Locked.php:57
Main Exception class.
Definition: Exception.php:18
Main DAV server class.
Definition: Server.php:23
$server
Definition: sabredav.php:48