BackendInterface.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. declare(strict_types=1);
  3. namespace Sabre\DAV\Locks\Backend;
  4. use Sabre\DAV\Locks;
  5. /**
  6. * If you are defining your own Locks backend, you must implement this
  7. * interface.
  8. *
  9. * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
  10. * @author Evert Pot (http://evertpot.com/)
  11. * @license http://sabre.io/license/ Modified BSD License
  12. */
  13. interface BackendInterface
  14. {
  15. /**
  16. * Returns a list of Sabre\DAV\Locks\LockInfo objects.
  17. *
  18. * This method should return all the locks for a particular uri, including
  19. * locks that might be set on a parent uri.
  20. *
  21. * If returnChildLocks is set to true, this method should also look for
  22. * any locks in the subtree of the uri for locks.
  23. *
  24. * @param string $uri
  25. * @param bool $returnChildLocks
  26. *
  27. * @return array
  28. */
  29. public function getLocks($uri, $returnChildLocks);
  30. /**
  31. * Locks a uri.
  32. *
  33. * @param string $uri
  34. *
  35. * @return bool
  36. */
  37. public function lock($uri, Locks\LockInfo $lockInfo);
  38. /**
  39. * Removes a lock from a uri.
  40. *
  41. * @param string $uri
  42. *
  43. * @return bool
  44. */
  45. public function unlock($uri, Locks\LockInfo $lockInfo);
  46. }