ConflictingLock.php 950 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. declare(strict_types=1);
  3. namespace Sabre\DAV\Exception;
  4. use Sabre\DAV;
  5. /**
  6. * ConflictingLock.
  7. *
  8. * Similar to the Locked exception, this exception thrown when a LOCK request
  9. * was made, on a resource which was already locked
  10. *
  11. * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
  12. * @author Evert Pot (http://evertpot.com/)
  13. * @license http://sabre.io/license/ Modified BSD License
  14. */
  15. class ConflictingLock extends Locked
  16. {
  17. /**
  18. * This method allows the exception to include additional information into the WebDAV error response.
  19. */
  20. public function serialize(DAV\Server $server, \DOMElement $errorNode)
  21. {
  22. if ($this->lock) {
  23. $error = $errorNode->ownerDocument->createElementNS('DAV:', 'd:no-conflicting-lock');
  24. $errorNode->appendChild($error);
  25. $error->appendChild($errorNode->ownerDocument->createElementNS('DAV:', 'd:href', $this->lock->uri));
  26. }
  27. }
  28. }