vendor/friendsofsymfony/user-bundle/Model/GroupableInterface.php line 14

Open in your IDE?
  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.  * @author Thibault Duplessis <thibault.duplessis@gmail.com>
  13.  * @author Johannes M. Schmitt <schmittjoh@gmail.com>
  14.  * @author Christophe Coevoet <stof@notk.org>
  15.  *
  16.  * @deprecated Using Groups is deprecated since version 2.2 and will be removed in 3.0.
  17.  */
  18. interface GroupableInterface
  19. {
  20.     /**
  21.      * Gets the groups granted to the user.
  22.      *
  23.      * @return \Traversable
  24.      */
  25.     public function getGroups();
  26.     /**
  27.      * Gets the name of the groups which includes the user.
  28.      *
  29.      * @return array
  30.      */
  31.     public function getGroupNames();
  32.     /**
  33.      * Indicates whether the user belongs to the specified group or not.
  34.      *
  35.      * @param string $name Name of the group
  36.      *
  37.      * @return bool
  38.      */
  39.     public function hasGroup($name);
  40.     /**
  41.      * Add a group to the user groups.
  42.      *
  43.      * @return static
  44.      */
  45.     public function addGroup(GroupInterface $group);
  46.     /**
  47.      * Remove a group from the user groups.
  48.      *
  49.      * @return static
  50.      */
  51.     public function removeGroup(GroupInterface $group);
  52. }