IGroup.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Joas Schilling <coding@schilljs.com>
  6. * @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  7. * @author Julius Härtl <jus@bitgrid.net>
  8. * @author Lukas Reschke <lukas@statuscode.ch>
  9. * @author Morris Jobke <hey@morrisjobke.de>
  10. * @author Robin Appelman <robin@icewind.nl>
  11. * @author Vincent Petry <pvince81@owncloud.com>
  12. *
  13. * @license AGPL-3.0
  14. *
  15. * This code is free software: you can redistribute it and/or modify
  16. * it under the terms of the GNU Affero General Public License, version 3,
  17. * as published by the Free Software Foundation.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU Affero General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU Affero General Public License, version 3,
  25. * along with this program. If not, see <http://www.gnu.org/licenses/>
  26. *
  27. */
  28. namespace OCP;
  29. /**
  30. * Interface IGroup
  31. *
  32. * @package OCP
  33. * @since 8.0.0
  34. */
  35. interface IGroup {
  36. /**
  37. * @return string
  38. * @since 8.0.0
  39. */
  40. public function getGID();
  41. /**
  42. * Returns the group display name
  43. *
  44. * @return string
  45. * @since 12.0.0
  46. */
  47. public function getDisplayName();
  48. /**
  49. * Set the group display name
  50. *
  51. * @param string $displayName
  52. * @return bool
  53. * @since 18.0.0
  54. */
  55. public function setDisplayName(string $displayName): bool;
  56. /**
  57. * get all users in the group
  58. *
  59. * @return \OCP\IUser[]
  60. * @since 8.0.0
  61. */
  62. public function getUsers();
  63. /**
  64. * check if a user is in the group
  65. *
  66. * @param \OCP\IUser $user
  67. * @return bool
  68. * @since 8.0.0
  69. */
  70. public function inGroup(IUser $user);
  71. /**
  72. * add a user to the group
  73. *
  74. * @param \OCP\IUser $user
  75. * @since 8.0.0
  76. */
  77. public function addUser(IUser $user);
  78. /**
  79. * remove a user from the group
  80. *
  81. * @param \OCP\IUser $user
  82. * @since 8.0.0
  83. */
  84. public function removeUser($user);
  85. /**
  86. * search for users in the group by userid
  87. *
  88. * @param string $search
  89. * @param int $limit
  90. * @param int $offset
  91. * @return \OCP\IUser[]
  92. * @since 8.0.0
  93. */
  94. public function searchUsers($search, $limit = null, $offset = null);
  95. /**
  96. * returns the number of users matching the search string
  97. *
  98. * @param string $search
  99. * @return int|bool
  100. * @since 8.0.0
  101. */
  102. public function count($search = '');
  103. /**
  104. * returns the number of disabled users
  105. *
  106. * @return int|bool
  107. * @since 14.0.0
  108. */
  109. public function countDisabled();
  110. /**
  111. * search for users in the group by displayname
  112. *
  113. * @param string $search
  114. * @param int $limit
  115. * @param int $offset
  116. * @return \OCP\IUser[]
  117. * @since 8.0.0
  118. */
  119. public function searchDisplayName($search, $limit = null, $offset = null);
  120. /**
  121. * delete the group
  122. *
  123. * @return bool
  124. * @since 8.0.0
  125. */
  126. public function delete();
  127. /**
  128. * @return bool
  129. * @since 14.0.0
  130. */
  131. public function canRemoveUser();
  132. /**
  133. * @return bool
  134. * @since 14.0.0
  135. */
  136. public function canAddUser();
  137. /**
  138. * @return bool
  139. * @since 16.0.0
  140. */
  141. public function hideFromCollaboration(): bool;
  142. }