vendor/bundles/FOS/UserBundle/Model/GroupManager.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  * Abstract Group Manager implementation which can be used as base class for your
       
    16  * concrete manager.
       
    17  *
       
    18  * @author Christophe Coevoet <stof@notk.org>
       
    19  */
       
    20 abstract class GroupManager implements GroupManagerInterface
       
    21 {
       
    22     /**
       
    23      * Returns an empty group instance.
       
    24      *
       
    25      * @param string $name
       
    26      * @return GroupInterface
       
    27      */
       
    28     public function createGroup($name)
       
    29     {
       
    30         $class = $this->getClass();
       
    31 
       
    32         return new $class($name);
       
    33     }
       
    34     /**
       
    35      * Finds a group by name.
       
    36      *
       
    37      * @param string $name
       
    38      * @return GroupInterface
       
    39      */
       
    40     public function findGroupByName($name)
       
    41     {
       
    42         return $this->findGroupBy(array('name' => $name));
       
    43     }
       
    44 }