IMetadataProvider.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCP\Calendar;
  7. /**
  8. * Interface IMetadataProvider
  9. *
  10. * Provider for metadata of a resource or a room
  11. *
  12. * @since 17.0.0
  13. */
  14. interface IMetadataProvider {
  15. /**
  16. * Get a list of all metadata keys available for this room
  17. *
  18. * Room backends are allowed to return custom keys, beyond the ones
  19. * defined in this class. If they do, they should make sure to use their
  20. * own namespace.
  21. *
  22. * @return String[] - A list of available keys
  23. * @since 17.0.0
  24. */
  25. public function getAllAvailableMetadataKeys():array;
  26. /**
  27. * Get whether or not a metadata key is set for this room
  28. *
  29. * @param string $key - The key to check for
  30. * @return bool - Whether or not key is available
  31. * @since 17.0.0
  32. */
  33. public function hasMetadataForKey(string $key):bool;
  34. /**
  35. * Get the value for a metadata key
  36. *
  37. * @param string $key - The key to check for
  38. * @return string|null - The value stored for the key, null if no value stored
  39. * @since 17.0.0
  40. */
  41. public function getMetadataForKey(string $key):?string;
  42. }