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