igroup.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /**
  3. * @author Morris Jobke <hey@morrisjobke.de>
  4. * @author Robin Appelman <icewind@owncloud.com>
  5. *
  6. * @copyright Copyright (c) 2015, ownCloud, Inc.
  7. * @license AGPL-3.0
  8. *
  9. * This code is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License, version 3,
  11. * as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License, version 3,
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>
  20. *
  21. */
  22. namespace OCP;
  23. interface IGroup {
  24. /**
  25. * @return string
  26. */
  27. public function getGID();
  28. /**
  29. * get all users in the group
  30. *
  31. * @return \OCP\IUser[]
  32. */
  33. public function getUsers();
  34. /**
  35. * check if a user is in the group
  36. *
  37. * @param \OCP\IUser $user
  38. * @return bool
  39. */
  40. public function inGroup($user);
  41. /**
  42. * add a user to the group
  43. *
  44. * @param \OCP\IUser $user
  45. */
  46. public function addUser($user);
  47. /**
  48. * remove a user from the group
  49. *
  50. * @param \OCP\IUser $user
  51. */
  52. public function removeUser($user);
  53. /**
  54. * search for users in the group by userid
  55. *
  56. * @param string $search
  57. * @param int $limit
  58. * @param int $offset
  59. * @return \OCP\IUser[]
  60. */
  61. public function searchUsers($search, $limit = null, $offset = null);
  62. /**
  63. * returns the number of users matching the search string
  64. *
  65. * @param string $search
  66. * @return int|bool
  67. */
  68. public function count($search = '');
  69. /**
  70. * search for users in the group by displayname
  71. *
  72. * @param string $search
  73. * @param int $limit
  74. * @param int $offset
  75. * @return \OCP\IUser[]
  76. */
  77. public function searchDisplayName($search, $limit = null, $offset = null);
  78. /**
  79. * delete the group
  80. *
  81. * @return bool
  82. */
  83. public function delete();
  84. }