GroupManagerInterface.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /*
  3. * This file is part of the FOSUserBundle package.
  4. *
  5. * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace FOS\UserBundle\Model;
  11. /**
  12. * Interface to be implemented by group managers. This adds an additional level
  13. * of abstraction between your application, and the actual repository.
  14. *
  15. * All changes to groups should happen through this interface.
  16. *
  17. * @author Christophe Coevoet <stof@notk.org>
  18. */
  19. interface GroupManagerInterface
  20. {
  21. /**
  22. * Returns an empty group instance.
  23. *
  24. * @param string $name
  25. *
  26. * @return GroupInterface
  27. */
  28. public function createGroup($name);
  29. /**
  30. * Deletes a group.
  31. *
  32. * @param GroupInterface $group
  33. *
  34. * @return void
  35. */
  36. public function deleteGroup(GroupInterface $group);
  37. /**
  38. * Finds one group by the given criteria.
  39. *
  40. * @param array $criteria
  41. *
  42. * @return GroupInterface
  43. */
  44. public function findGroupBy(array $criteria);
  45. /**
  46. * Finds a group by name.
  47. *
  48. * @param string $name
  49. *
  50. * @return GroupInterface
  51. */
  52. public function findGroupByName($name);
  53. /**
  54. * Returns a collection with all user instances.
  55. *
  56. * @return \Traversable
  57. */
  58. public function findGroups();
  59. /**
  60. * Returns the group's fully qualified class name.
  61. *
  62. * @return string
  63. */
  64. public function getClass();
  65. /**
  66. * Updates a group.
  67. *
  68. * @param GroupInterface $group
  69. *
  70. * @return void
  71. */
  72. public function updateGroup(GroupInterface $group);
  73. }