123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <?php
- /*
- * This file is part of the Sonata Project package.
- *
- * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
- namespace Sonata\UserBundle\Entity;
- use Doctrine\Common\Persistence\ManagerRegistry;
- use Sonata\CoreBundle\Model\BaseEntityManager;
- /**
- * This UserManageProxy class is used to keep UserManager compatible with Sonata ManagerInterface implementation
- * because UserManager implements FOSUserBundle manager interface.
- *
- * @author Sylvain Deloux <sylvain.deloux@ekino.com>
- */
- class UserManagerProxy extends BaseEntityManager
- {
- /**
- * @var UserManager
- */
- protected $userManager;
- /**
- * UserManagerProxy constructor.
- *
- * @param string $class
- * @param ManagerRegistry $registry
- * @param UserManager $userManager
- */
- public function __construct($class, ManagerRegistry $registry, UserManager $userManager)
- {
- parent::__construct($class, $registry);
- $this->userManager = $userManager;
- }
- /**
- * {@inheritdoc}
- */
- public function getClass()
- {
- return $this->userManager->getClass();
- }
- /**
- * {@inheritdoc}
- */
- public function findAll()
- {
- return $this->userManager->findAll();
- }
- /**
- * {@inheritdoc}
- */
- public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
- {
- return $this->userManager->findBy($criteria, $orderBy, $limit, $offset);
- }
- /**
- * {@inheritdoc}
- */
- public function findOneBy(array $criteria, array $orderBy = null)
- {
- return $this->userManager->findOneBy($criteria, $orderBy);
- }
- /**
- * {@inheritdoc}
- */
- public function find($id)
- {
- return $this->userManager->find($id);
- }
- /**
- * {@inheritdoc}
- */
- public function create()
- {
- return $this->userManager->create();
- }
- /**
- * {@inheritdoc}
- */
- public function save($entity, $andFlush = true)
- {
- return $this->userManager->save($entity, $andFlush);
- }
- /**
- * {@inheritdoc}
- */
- public function delete($entity, $andFlush = true)
- {
- return $this->userManager->delete($entity, $andFlush);
- }
- /**
- * {@inheritdoc}
- */
- public function getTableName()
- {
- return $this->userManager->getTableName();
- }
- /**
- * {@inheritdoc}
- */
- public function getConnection()
- {
- return $this->userManager->getConnection();
- }
- }
|