vendor/bundles/FOS/UserBundle/Model/GroupableInterface.php
changeset 3 e54dfe4d0b2b
equal deleted inserted replaced
2:806e57d67020 3:e54dfe4d0b2b
       
     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  * @author Thibault Duplessis <thibault.duplessis@gmail.com>
       
    16  * @author Johannes M. Schmitt <schmittjoh@gmail.com>
       
    17  * @author Christophe Coevoet <stof@notk.org>
       
    18  */
       
    19 interface GroupableInterface
       
    20 {
       
    21     /**
       
    22      * Gets the groups granted to the user.
       
    23      *
       
    24      * @return \Doctrine\Common\Collections\Collection
       
    25      */
       
    26     function getGroups();
       
    27 
       
    28     /**
       
    29      * Gets the name of the groups which includes the user.
       
    30      *
       
    31      * @return array
       
    32      */
       
    33     function getGroupNames();
       
    34 
       
    35     /**
       
    36      * Indicates whether the user belongs to the specified group or not.
       
    37      *
       
    38      * @param string $name Name of the group
       
    39      * @return Boolean
       
    40      */
       
    41     function hasGroup($name);
       
    42 
       
    43     /**
       
    44      * Add a group to the user groups.
       
    45      *
       
    46      * @param GroupInterface $group
       
    47      */
       
    48     function addGroup(GroupInterface $group);
       
    49 
       
    50     /**
       
    51      * Remove a group from the user groups.
       
    52      *
       
    53      * @param GroupInterface $group
       
    54      */
       
    55     function removeGroup(GroupInterface $group);
       
    56 }