vendor/sonata-project/user-bundle/src/Entity/UserManagerProxy.php line 25

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4.  * This file is part of the Sonata Project package.
  5.  *
  6.  * (c) Thomas Rabaix <[email protected]>
  7.  *
  8.  * For the full copyright and license information, please view the LICENSE
  9.  * file that was distributed with this source code.
  10.  */
  11. namespace Sonata\UserBundle\Entity;
  12. use Doctrine\Common\Persistence\ManagerRegistry;
  13. use Sonata\CoreBundle\Model\BaseEntityManager;
  14. /**
  15.  * This UserManageProxy class is used to keep UserManager compatible with Sonata ManagerInterface implementation
  16.  * because UserManager implements FOSUserBundle manager interface.
  17.  *
  18.  * @author Sylvain Deloux <[email protected]>
  19.  */
  20. class UserManagerProxy extends BaseEntityManager
  21. {
  22.     /**
  23.      * @var UserManager
  24.      */
  25.     protected $userManager;
  26.     /**
  27.      * UserManagerProxy constructor.
  28.      *
  29.      * @param string $class
  30.      */
  31.     public function __construct($classManagerRegistry $registryUserManager $userManager)
  32.     {
  33.         parent::__construct($class$registry);
  34.         $this->userManager $userManager;
  35.     }
  36.     /**
  37.      * {@inheritdoc}
  38.      */
  39.     public function getClass()
  40.     {
  41.         return $this->userManager->getClass();
  42.     }
  43.     /**
  44.      * {@inheritdoc}
  45.      */
  46.     public function findAll()
  47.     {
  48.         return $this->userManager->findAll();
  49.     }
  50.     /**
  51.      * {@inheritdoc}
  52.      */
  53.     public function findBy(array $criteria, array $orderBy null$limit null$offset null)
  54.     {
  55.         return $this->userManager->findBy($criteria$orderBy$limit$offset);
  56.     }
  57.     /**
  58.      * {@inheritdoc}
  59.      */
  60.     public function findOneBy(array $criteria, array $orderBy null)
  61.     {
  62.         return $this->userManager->findOneBy($criteria$orderBy);
  63.     }
  64.     /**
  65.      * {@inheritdoc}
  66.      */
  67.     public function find($id)
  68.     {
  69.         return $this->userManager->find($id);
  70.     }
  71.     /**
  72.      * {@inheritdoc}
  73.      */
  74.     public function create()
  75.     {
  76.         return $this->userManager->create();
  77.     }
  78.     /**
  79.      * {@inheritdoc}
  80.      */
  81.     public function save($entity$andFlush true)
  82.     {
  83.         return $this->userManager->save($entity$andFlush);
  84.     }
  85.     /**
  86.      * {@inheritdoc}
  87.      */
  88.     public function delete($entity$andFlush true)
  89.     {
  90.         return $this->userManager->delete($entity$andFlush);
  91.     }
  92.     /**
  93.      * {@inheritdoc}
  94.      */
  95.     public function getTableName()
  96.     {
  97.         return $this->userManager->getTableName();
  98.     }
  99.     /**
  100.      * {@inheritdoc}
  101.      */
  102.     public function getConnection()
  103.     {
  104.         return $this->userManager->getConnection();
  105.     }
  106. }