SearchQuery.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
  4. *
  5. * @author Robin Appelman <robin@icewind.nl>
  6. *
  7. * @license GNU AGPL version 3 or any later version
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License as
  11. * published by the Free Software Foundation, either version 3 of the
  12. * License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. *
  22. */
  23. namespace OC\Files\Search;
  24. use OCP\Files\Search\ISearchOperator;
  25. use OCP\Files\Search\ISearchOrder;
  26. use OCP\Files\Search\ISearchQuery;
  27. use OCP\IUser;
  28. class SearchQuery implements ISearchQuery {
  29. /** @var ISearchOperator */
  30. private $searchOperation;
  31. /** @var integer */
  32. private $limit;
  33. /** @var integer */
  34. private $offset;
  35. /** @var ISearchOrder[] */
  36. private $order;
  37. /** @var IUser */
  38. private $user;
  39. /**
  40. * SearchQuery constructor.
  41. *
  42. * @param ISearchOperator $searchOperation
  43. * @param int $limit
  44. * @param int $offset
  45. * @param array $order
  46. * @param IUser $user
  47. */
  48. public function __construct(ISearchOperator $searchOperation, $limit, $offset, array $order, IUser $user) {
  49. $this->searchOperation = $searchOperation;
  50. $this->limit = $limit;
  51. $this->offset = $offset;
  52. $this->order = $order;
  53. $this->user = $user;
  54. }
  55. /**
  56. * @return ISearchOperator
  57. */
  58. public function getSearchOperation() {
  59. return $this->searchOperation;
  60. }
  61. /**
  62. * @return int
  63. */
  64. public function getLimit() {
  65. return $this->limit;
  66. }
  67. /**
  68. * @return int
  69. */
  70. public function getOffset() {
  71. return $this->offset;
  72. }
  73. /**
  74. * @return ISearchOrder[]
  75. */
  76. public function getOrder() {
  77. return $this->order;
  78. }
  79. /**
  80. * @return IUser
  81. */
  82. public function getUser() {
  83. return $this->user;
  84. }
  85. }