1
0

IBatchMethodsBackend.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Group\Backend;
  8. /**
  9. * @brief Optional interface for group backends
  10. * @since 28.0.0
  11. */
  12. interface IBatchMethodsBackend {
  13. /**
  14. * @brief Batch method to check if a list of groups exists
  15. *
  16. * The default implementation in ABackend will just call groupExists in
  17. * a loop. But a GroupBackend implementation should provides a more optimized
  18. * override this method to provide a more optimized way to execute this operation.
  19. *
  20. * @param list<string> $gids
  21. * @return list<string> the list of group that exists
  22. * @since 28.0.0
  23. */
  24. public function groupsExists(array $gids): array;
  25. /**
  26. * @brief Batch method to get the group details of a list of groups
  27. *
  28. * The default implementation in ABackend will just call getGroupDetails in
  29. * a loop. But a GroupBackend implementation should override this method
  30. * to provide a more optimized way to execute this operation.
  31. *
  32. * @throw \RuntimeException if called on a backend that doesn't implements IGroupDetailsBackend
  33. *
  34. * @return array<string, array{displayName?: string}>
  35. * @since 28.0.0
  36. */
  37. public function getGroupsDetails(array $gids): array;
  38. }