igroup.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Morris Jobke <hey@morrisjobke.de>
  6. * @author Robin Appelman <robin@icewind.nl>
  7. *
  8. * @license AGPL-3.0
  9. *
  10. * This code is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License, version 3,
  12. * as published by the Free Software Foundation.
  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, version 3,
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>
  21. *
  22. */
  23. namespace OCP;
  24. /**
  25. * Interface IGroup
  26. *
  27. * @package OCP
  28. * @since 8.0.0
  29. */
  30. interface IGroup {
  31. /**
  32. * @return string
  33. * @since 8.0.0
  34. */
  35. public function getGID();
  36. /**
  37. * get all users in the group
  38. *
  39. * @return \OCP\IUser[]
  40. * @since 8.0.0
  41. */
  42. public function getUsers();
  43. /**
  44. * check if a user is in the group
  45. *
  46. * @param \OCP\IUser $user
  47. * @return bool
  48. * @since 8.0.0
  49. */
  50. public function inGroup($user);
  51. /**
  52. * add a user to the group
  53. *
  54. * @param \OCP\IUser $user
  55. * @since 8.0.0
  56. */
  57. public function addUser($user);
  58. /**
  59. * remove a user from the group
  60. *
  61. * @param \OCP\IUser $user
  62. * @since 8.0.0
  63. */
  64. public function removeUser($user);
  65. /**
  66. * search for users in the group by userid
  67. *
  68. * @param string $search
  69. * @param int $limit
  70. * @param int $offset
  71. * @return \OCP\IUser[]
  72. * @since 8.0.0
  73. */
  74. public function searchUsers($search, $limit = null, $offset = null);
  75. /**
  76. * returns the number of users matching the search string
  77. *
  78. * @param string $search
  79. * @return int|bool
  80. * @since 8.0.0
  81. */
  82. public function count($search = '');
  83. /**
  84. * search for users in the group by displayname
  85. *
  86. * @param string $search
  87. * @param int $limit
  88. * @param int $offset
  89. * @return \OCP\IUser[]
  90. * @since 8.0.0
  91. */
  92. public function searchDisplayName($search, $limit = null, $offset = null);
  93. /**
  94. * delete the group
  95. *
  96. * @return bool
  97. * @since 8.0.0
  98. */
  99. public function delete();
  100. }