ICopyTarget.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 copied into this collection".
  7. *
  8. * If a backend supports a better optimized copy operation, e.g. by avoiding
  9. * copying the contents, this can trigger some huge speed gains.
  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. interface ICopyTarget extends ICollection
  16. {
  17. /**
  18. * Copies a node into this collection.
  19. *
  20. * It is up to the implementors to:
  21. * 1. Create the new resource.
  22. * 2. Copy the data and any properties.
  23. *
  24. * If you return true from this function, the assumption
  25. * is that the copy was successful.
  26. * If you return false, sabre/dav will handle the copy itself.
  27. *
  28. * @param string $targetName new local file/collection name
  29. * @param string $sourcePath Full path to source node
  30. * @param INode $sourceNode Source node itself
  31. *
  32. * @return bool
  33. */
  34. public function copyInto($targetName, $sourcePath, INode $sourceNode);
  35. }