Skip to content

Commit a0c135f

Browse files
committed
Use the EntityManager interface ObjectManager
Its possible to decorate the EntityManager which will result in all sorts of errors. Using the ObjectManager interface allows for decorated EntityManagers
1 parent 0c72d8b commit a0c135f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Entity/AuthCodeManager.php

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

1212
namespace FOS\OAuthServerBundle\Entity;
1313

14-
use Doctrine\ORM\EntityManager;
14+
use Doctrine\Common\Persistence\ObjectManager;
1515
use FOS\OAuthServerBundle\Model\AuthCodeInterface;
1616
use FOS\OAuthServerBundle\Model\AuthCodeManager as BaseAuthCodeManager;
1717

@@ -36,7 +36,7 @@ class AuthCodeManager extends BaseAuthCodeManager
3636
* @param \Doctrine\ORM\EntityManager $em
3737
* @param string $class
3838
*/
39-
public function __construct(EntityManager $em, $class)
39+
public function __construct(ObjectManager $em, $class)
4040
{
4141
$this->em = $em;
4242
$this->repository = $em->getRepository($class);

Entity/ClientManager.php

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

1212
namespace FOS\OAuthServerBundle\Entity;
1313

14-
use Doctrine\ORM\EntityManager;
14+
use Doctrine\Common\Persistence\ObjectManager;
1515
use FOS\OAuthServerBundle\Model\ClientInterface;
1616
use FOS\OAuthServerBundle\Model\ClientManager as BaseClientManager;
1717

@@ -32,7 +32,7 @@ class ClientManager extends BaseClientManager
3232
*/
3333
protected $class;
3434

35-
public function __construct(EntityManager $em, $class)
35+
public function __construct(ObjectManager $em, $class)
3636
{
3737
$this->em = $em;
3838
$this->repository = $em->getRepository($class);

Entity/TokenManager.php

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

1212
namespace FOS\OAuthServerBundle\Entity;
1313

14-
use Doctrine\ORM\EntityManager;
14+
use Doctrine\Common\Persistence\ObjectManager;
1515
use FOS\OAuthServerBundle\Model\TokenInterface;
1616
use FOS\OAuthServerBundle\Model\TokenManager as BaseTokenManager;
1717

@@ -32,7 +32,7 @@ class TokenManager extends BaseTokenManager
3232
*/
3333
protected $class;
3434

35-
public function __construct(EntityManager $em, $class)
35+
public function __construct(ObjectManager $em, $class)
3636
{
3737
$this->em = $em;
3838
$this->repository = $em->getRepository($class);

0 commit comments

Comments
 (0)