1
0

IGroup.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. * @author Vincent Petry <PVince81@owncloud.com>
  8. *
  9. * @license AGPL-3.0
  10. *
  11. * This code is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License, version 3,
  13. * as published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License, version 3,
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>
  22. *
  23. */
  24. namespace OCP;
  25. /**
  26. * Interface IGroup
  27. *
  28. * @package OCP
  29. * @since 8.0.0
  30. */
  31. interface IGroup {
  32. /**
  33. * @return string
  34. * @since 8.0.0
  35. */
  36. public function getGID();
  37. /**
  38. * Returns the group display name
  39. *
  40. * @return string
  41. * @since 9.2
  42. */
  43. public function getDisplayName();
  44. /**
  45. * get all users in the group
  46. *
  47. * @return \OCP\IUser[]
  48. * @since 8.0.0
  49. */
  50. public function getUsers();
  51. /**
  52. * check if a user is in the group
  53. *
  54. * @param \OCP\IUser $user
  55. * @return bool
  56. * @since 8.0.0
  57. */
  58. public function inGroup($user);
  59. /**
  60. * add a user to the group
  61. *
  62. * @param \OCP\IUser $user
  63. * @since 8.0.0
  64. */
  65. public function addUser($user);
  66. /**
  67. * remove a user from the group
  68. *
  69. * @param \OCP\IUser $user
  70. * @since 8.0.0
  71. */
  72. public function removeUser($user);
  73. /**
  74. * search for users in the group by userid
  75. *
  76. * @param string $search
  77. * @param int $limit
  78. * @param int $offset
  79. * @return \OCP\IUser[]
  80. * @since 8.0.0
  81. */
  82. public function searchUsers($search, $limit = null, $offset = null);
  83. /**
  84. * returns the number of users matching the search string
  85. *
  86. * @param string $search
  87. * @return int|bool
  88. * @since 8.0.0
  89. */
  90. public function count($search = '');
  91. /**
  92. * search for users in the group by displayname
  93. *
  94. * @param string $search
  95. * @param int $limit
  96. * @param int $offset
  97. * @return \OCP\IUser[]
  98. * @since 8.0.0
  99. */
  100. public function searchDisplayName($search, $limit = null, $offset = null);
  101. /**
  102. * delete the group
  103. *
  104. * @return bool
  105. * @since 8.0.0
  106. */
  107. public function delete();
  108. }