GroupManager.php 829 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. * Abstract Group Manager implementation which can be used as base class for your
  13. * concrete manager.
  14. *
  15. * @author Christophe Coevoet <stof@notk.org>
  16. */
  17. abstract class GroupManager implements GroupManagerInterface
  18. {
  19. /**
  20. * {@inheritDoc}
  21. */
  22. public function createGroup($name)
  23. {
  24. $class = $this->getClass();
  25. return new $class($name);
  26. }
  27. /**
  28. * {@inheritDoc}
  29. */
  30. public function findGroupByName($name)
  31. {
  32. return $this->findGroupBy(array('name' => $name));
  33. }
  34. }