Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ce41b8e

Browse files
committed
merged branch stof/entity_provider (PR #2923)
Commits ------- f1199c0 [DoctrineBridge] Decoupled the EntityUserProvider from the ORM Discussion ---------- [DoctrineBridge] Decoupled the EntityUserProvider from the ORM Bug fix: no Feature addition: yes Backwards compatibility break: yes Symfony2 tests pass: yes The entity provider can now be used by any Doctrine project implementing the interfaces from Doctrine Common 2.2.
2 parents ddf6534 + f1199c0 commit ce41b8e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
namespace Symfony\Bridge\Doctrine\Security\User;
1313

14-
use Doctrine\ORM\EntityManager;
14+
use Doctrine\Common\Persistence\ObjectManager;
1515
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
1616
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
1717
use Symfony\Component\Security\Core\User\UserProviderInterface;
1818
use Symfony\Component\Security\Core\User\UserInterface;
1919

2020
/**
21-
* Wrapper around a Doctrine EntityManager.
21+
* Wrapper around a Doctrine ObjectManager.
2222
*
2323
* Provides easy to use provisioning for Doctrine entity users.
2424
*
@@ -32,13 +32,13 @@ class EntityUserProvider implements UserProviderInterface
3232
private $property;
3333
private $metadata;
3434

35-
public function __construct(EntityManager $em, $class, $property = null)
35+
public function __construct(ObjectManager $em, $class, $property = null)
3636
{
3737
$this->class = $class;
3838
$this->metadata = $em->getClassMetadata($class);
3939

4040
if (false !== strpos($this->class, ':')) {
41-
$this->class = $this->metadata->name;
41+
$this->class = $this->metadata->getName();
4242
}
4343

4444
$this->repository = $em->getRepository($class);

0 commit comments

Comments
 (0)