INodeByPath.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. declare(strict_types=1);
  3. namespace Sabre\DAV;
  4. /**
  5. * INodeByPath.
  6. *
  7. * This interface adds a tiny bit of functionality to collections.
  8. *
  9. * Getting a node that is deep in the tree normally requires going trough each parent node
  10. * which can cause a significant performance overhead.
  11. *
  12. * Implementing this interface allows solving this overhead by directly jumping to the target node.
  13. *
  14. * @copyright Copyright (C) Robin Appelman (https://icewind.nl/)
  15. * @author Robin Appelman (https://icewind.nl/)
  16. * @license http://sabre.io/license/ Modified BSD License
  17. */
  18. interface INodeByPath
  19. {
  20. /**
  21. * Returns the INode object for the requested path.
  22. *
  23. * In case where this collection can not retrieve the requested node
  24. * but also can not determine that the node does not exists,
  25. * null should be returned to signal that the caller should fallback
  26. * to walking the directory tree.
  27. *
  28. * @param string $path
  29. *
  30. * @return INode|null
  31. */
  32. public function getNodeForPath($path);
  33. }