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.

76 lines
2.0 KiB

3 years ago
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  6. * @author Joas Schilling <coding@schilljs.com>
  7. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  8. * @author Lukas Reschke <lukas@statuscode.ch>
  9. * @author Morris Jobke <hey@morrisjobke.de>
  10. * @author Roeland Jago Douma <roeland@famdouma.nl>
  11. *
  12. * @license AGPL-3.0
  13. *
  14. * This code is free software: you can redistribute it and/or modify
  15. * it under the terms of the GNU Affero General Public License, version 3,
  16. * as published by the Free Software Foundation.
  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, version 3,
  24. * along with this program. If not, see <http://www.gnu.org/licenses/>
  25. *
  26. */
  27. namespace OCP\Search;
  28. /**
  29. * Provides a template for search functionality throughout ownCloud;
  30. * @since 8.0.0
  31. * @deprecated 20.0.0
  32. */
  33. abstract class PagedProvider extends Provider {
  34. /**
  35. * show all results
  36. * @since 8.0.0
  37. * @deprecated 20.0.0
  38. */
  39. public const SIZE_ALL = 0;
  40. /**
  41. * Constructor
  42. * @param array $options
  43. * @since 8.0.0
  44. * @deprecated 20.0.0
  45. */
  46. public function __construct($options) {
  47. parent::__construct($options);
  48. }
  49. /**
  50. * Search for $query
  51. * @param string $query
  52. * @return array An array of OCP\Search\Result's
  53. * @since 8.0.0
  54. * @deprecated 20.0.0
  55. */
  56. public function search($query) {
  57. // old apps might assume they get all results, so we use SIZE_ALL
  58. return $this->searchPaged($query, 1, self::SIZE_ALL);
  59. }
  60. /**
  61. * Search for $query
  62. * @param string $query
  63. * @param int $page pages start at page 1
  64. * @param int $size 0 = SIZE_ALL
  65. * @return array An array of OCP\Search\Result's
  66. * @since 8.0.0
  67. * @deprecated 20.0.0
  68. */
  69. abstract public function searchPaged($query, $page, $size);
  70. }