IMoveTarget.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. declare(strict_types=1);
  3. namespace Sabre\DAV;
  4. /**
  5. * By implementing this interface, a collection can effectively say "other
  6. * nodes may be moved into this collection".
  7. *
  8. * The benefit of this, is that sabre/dav will by default perform a move, by
  9. * transferring an entire directory tree, copying every collection, and deleting
  10. * every item.
  11. *
  12. * If a backend supports a better optimized move operation, this can trigger
  13. * some huge speed gains.
  14. *
  15. * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
  16. * @author Evert Pot (http://evertpot.com/)
  17. * @license http://sabre.io/license/ Modified BSD License
  18. */
  19. interface IMoveTarget extends ICollection
  20. {
  21. /**
  22. * Moves a node into this collection.
  23. *
  24. * It is up to the implementors to:
  25. * 1. Create the new resource.
  26. * 2. Remove the old resource.
  27. * 3. Transfer any properties or other data.
  28. *
  29. * Generally you should make very sure that your collection can easily move
  30. * the move.
  31. *
  32. * If you don't, just return false, which will trigger sabre/dav to handle
  33. * the move itself. If you return true from this function, the assumption
  34. * is that the move was successful.
  35. *
  36. * @param string $targetName new local file/collection name
  37. * @param string $sourcePath Full path to source node
  38. * @param INode $sourceNode Source node itself
  39. *
  40. * @return bool
  41. */
  42. public function moveInto($targetName, $sourcePath, INode $sourceNode);
  43. }