ICollection.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /**
  3. * The ICollection Interface
  4. *
  5. * This interface should be implemented by each class that represents a collection
  6. *
  7. * @package Sabre
  8. * @subpackage DAV
  9. * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
  10. * @author Evert Pot (http://www.rooftopsolutions.nl/)
  11. * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
  12. */
  13. interface Sabre_DAV_ICollection extends Sabre_DAV_INode {
  14. /**
  15. * Creates a new file in the directory
  16. *
  17. * Data will either be supplied as a stream resource, or in certain cases
  18. * as a string. Keep in mind that you may have to support either.
  19. *
  20. * After succesful creation of the file, you may choose to return the ETag
  21. * of the new file here.
  22. *
  23. * The returned ETag must be surrounded by double-quotes (The quotes should
  24. * be part of the actual string).
  25. *
  26. * If you cannot accurately determine the ETag, you should not return it.
  27. * If you don't store the file exactly as-is (you're transforming it
  28. * somehow) you should also not return an ETag.
  29. *
  30. * This means that if a subsequent GET to this new file does not exactly
  31. * return the same contents of what was submitted here, you are strongly
  32. * recommended to omit the ETag.
  33. *
  34. * @param string $name Name of the file
  35. * @param resource|string $data Initial payload
  36. * @return null|string
  37. */
  38. function createFile($name, $data = null);
  39. /**
  40. * Creates a new subdirectory
  41. *
  42. * @param string $name
  43. * @return void
  44. */
  45. function createDirectory($name);
  46. /**
  47. * Returns a specific child node, referenced by its name
  48. *
  49. * @param string $name
  50. * @return Sabre_DAV_INode
  51. */
  52. function getChild($name);
  53. /**
  54. * Returns an array with all the child nodes
  55. *
  56. * @return Sabre_DAV_INode[]
  57. */
  58. function getChildren();
  59. /**
  60. * Checks if a child-node with the specified name exists
  61. *
  62. * @param string $name
  63. * @return bool
  64. */
  65. function childExists($name);
  66. }