ISearchableGroupBackend.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Group\Backend;
  8. use OCP\IUser;
  9. /**
  10. * @since 27.0.0
  11. */
  12. interface ISearchableGroupBackend {
  13. /**
  14. * @brief Get a list of users matching the given search parameters.
  15. *
  16. * Implementations of this method should return lazy evaluated user objects and
  17. * preload if possible the display name.
  18. *
  19. * <code>
  20. * $users = $groupBackend->searchInGroup('admin', 'John', 10, 0);
  21. * </code>
  22. *
  23. * @param string $gid The group id of the user we want to search
  24. * @param string $search The part of the display name or user id of the users we
  25. * want to search. This can be empty to get all the users.
  26. * @param int $limit The limit of results
  27. * @param int $offset The offset of the results
  28. * @return array<string,IUser> Users indexed by uid
  29. * @since 27.0.0
  30. */
  31. public function searchInGroup(string $gid, string $search = '', int $limit = -1, int $offset = 0): array;
  32. }