AutoCompleteEvent.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2019 Joas Schilling <coding@schilljs.com>
  5. *
  6. * @license GNU AGPL version 3 or any later version
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Affero General Public License as
  10. * published by the Free Software Foundation, either version 3 of the
  11. * License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. namespace OCP\Collaboration\AutoComplete;
  23. use Symfony\Component\EventDispatcher\GenericEvent;
  24. /**
  25. * @since 16.0.0
  26. */
  27. class AutoCompleteEvent extends GenericEvent {
  28. /**
  29. * @param array $arguments
  30. * @since 16.0.0
  31. */
  32. public function __construct(array $arguments) {
  33. parent::__construct(null, $arguments);
  34. }
  35. /**
  36. * @since 16.0.0
  37. */
  38. public function getResults(): array {
  39. return $this->getArgument('results');
  40. }
  41. /**
  42. * @param array $results
  43. * @since 16.0.0
  44. */
  45. public function setResults(array $results): void {
  46. $this->setArgument('results', $results);
  47. }
  48. /**
  49. * @since 16.0.0
  50. */
  51. public function getSearchTerm(): string {
  52. return $this->getArgument('search');
  53. }
  54. /**
  55. * @return int[]
  56. * @since 16.0.0
  57. */
  58. public function getShareTypes(): array {
  59. return $this->getArgument('shareTypes');
  60. }
  61. /**
  62. * @since 16.0.0
  63. */
  64. public function getItemType(): string {
  65. return $this->getArgument('itemType');
  66. }
  67. /**
  68. * @since 16.0.0
  69. */
  70. public function getItemId(): string {
  71. return $this->getArgument('itemId');
  72. }
  73. /**
  74. * @since 16.0.0
  75. */
  76. public function getSorter(): string {
  77. return $this->getArgument('sorter');
  78. }
  79. /**
  80. * @since 16.0.0
  81. */
  82. public function getLimit(): int {
  83. return $this->getArgument('limit');
  84. }
  85. }