IPrincipalCollection.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. declare(strict_types=1);
  3. namespace Sabre\DAVACL;
  4. use Sabre\DAV;
  5. /**
  6. * Principal Collection interface.
  7. *
  8. * Implement this interface to ensure that your principal collection can be
  9. * searched using the principal-property-search REPORT.
  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 IPrincipalCollection extends DAV\ICollection
  16. {
  17. /**
  18. * This method is used to search for principals matching a set of
  19. * properties.
  20. *
  21. * This search is specifically used by RFC3744's principal-property-search
  22. * REPORT. You should at least allow searching on
  23. * http://sabredav.org/ns}email-address.
  24. *
  25. * The actual search should be a unicode-non-case-sensitive search. The
  26. * keys in searchProperties are the WebDAV property names, while the values
  27. * are the property values to search on.
  28. *
  29. * By default, if multiple properties are submitted to this method, the
  30. * various properties should be combined with 'AND'. If $test is set to
  31. * 'anyof', it should be combined using 'OR'.
  32. *
  33. * This method should simply return a list of 'child names', which may be
  34. * used to call $this->getChild in the future.
  35. *
  36. * @param string $test
  37. *
  38. * @return array
  39. */
  40. public function searchPrincipals(array $searchProperties, $test = 'allof');
  41. /**
  42. * Finds a principal by its URI.
  43. *
  44. * This method may receive any type of uri, but mailto: addresses will be
  45. * the most common.
  46. *
  47. * Implementation of this API is optional. It is currently used by the
  48. * CalDAV system to find principals based on their email addresses. If this
  49. * API is not implemented, some features may not work correctly.
  50. *
  51. * This method must return a relative principal path, or null, if the
  52. * principal was not found or you refuse to find it.
  53. *
  54. * @param string $uri
  55. *
  56. * @return string
  57. */
  58. public function findByUri($uri);
  59. }