Using Groups With FOSUserBundle =============================== FOSUserBundle allows you to associate groups to your users. Groups are a way to group a collection of roles. The roles of a group will be granted to all users belonging to it. **Note:** > Symfony2 supports role inheritance so inheriting roles from groups is not > always needed. If the role inheritance is enough for your use case, it > is better to use it instead of groups as it is more efficient (loading > the groups triggers the database). To use the groups, you need to explicitly enable this functionality in your configuration. The only mandatory configuration is the fully qualified class name (FQCN) of your `Group` class which must implement `FOS\UserBundle\Model\GroupInterface`. Below is an example configuration for enabling groups support. In YAML: ``` yaml # app/config/config.yml fos_user: db_driver: orm firewall_name: main user_class: Acme\UserBundle\Entity\User group: group_class: Acme\UserBundle\Entity\Group ``` Or if you prefer XML: ``` xml # app/config/config.xml ``` ### The Group class The simplest way to create a Group class is to extend the mapped superclass provided by the bundle. **a) ORM Group class implementation** ``` php // src/MyProject/MyBundle/Entity/Group.php