You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IIndexOptions.php 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * FullTextSearch - Full text search framework for Nextcloud
  5. *
  6. * This file is licensed under the Affero General Public License version 3 or
  7. * later. See the COPYING file.
  8. *
  9. * @author Maxence Lange <maxence@artificial-owl.com>
  10. * @copyright 2018
  11. * @license GNU AGPL version 3 or any later version
  12. *
  13. * This program is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License as
  15. * published by the Free Software Foundation, either version 3 of the
  16. * License, or (at your option) any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU Affero General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Affero General Public License
  24. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  25. *
  26. */
  27. namespace OCP\FullTextSearch\Model;
  28. /**
  29. * Interface IIndexOptions
  30. *
  31. * IndexOptions are created in FullTextSearch when an admin initiate an index
  32. * from the command line:
  33. *
  34. * ./occ fulltextsearch:index "{\"option1\": \"value\", \"option2\": true}"
  35. *
  36. * @since 15.0.0
  37. *
  38. * @package OCP\FullTextSearch\Model
  39. */
  40. interface IIndexOptions {
  41. /**
  42. * Get the value (as a string) for an option.
  43. *
  44. * @since 15.0.0
  45. *
  46. * @param string $option
  47. * @param string $default
  48. *
  49. * @return string
  50. */
  51. public function getOption(string $option, string $default = ''): string;
  52. /**
  53. * Get the value (as an array) for an option.
  54. *
  55. * @since 15.0.0
  56. *
  57. * @param string $option
  58. * @param array $default
  59. *
  60. * @return array
  61. */
  62. public function getOptionArray(string $option, array $default = []): array;
  63. /**
  64. * Get the value (as an boolean) for an option.
  65. *
  66. * @since 15.0.0
  67. *
  68. * @param string $option
  69. * @param bool $default
  70. *
  71. * @return bool
  72. */
  73. public function getOptionBool(string $option, bool $default): bool;
  74. }