IIndexOptions.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\FullTextSearch\Model;
  8. /**
  9. * Interface IIndexOptions
  10. *
  11. * IndexOptions are created in FullTextSearch when an admin initiate an index
  12. * from the command line:
  13. *
  14. * ./occ fulltextsearch:index "{\"option1\": \"value\", \"option2\": true}"
  15. *
  16. * @since 15.0.0
  17. *
  18. */
  19. interface IIndexOptions {
  20. /**
  21. * Get the value (as a string) for an option.
  22. *
  23. * @since 15.0.0
  24. *
  25. * @param string $option
  26. * @param string $default
  27. *
  28. * @return string
  29. */
  30. public function getOption(string $option, string $default = ''): string;
  31. /**
  32. * Get the value (as an array) for an option.
  33. *
  34. * @since 15.0.0
  35. *
  36. * @param string $option
  37. * @param array $default
  38. *
  39. * @return array
  40. */
  41. public function getOptionArray(string $option, array $default = []): array;
  42. /**
  43. * Get the value (as an boolean) for an option.
  44. *
  45. * @since 15.0.0
  46. *
  47. * @param string $option
  48. * @param bool $default
  49. *
  50. * @return bool
  51. */
  52. public function getOptionBool(string $option, bool $default): bool;
  53. }