File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 7
7
use Doctrine \ORM \EntityManagerInterface ;
8
8
use Doctrine \ORM \Tools \Console \EntityManagerProvider as DoctrineEntityManagerProvider ;
9
9
use Doctrine \Persistence \ManagerRegistry ;
10
+ use Illuminate \Contracts \Container \Container ;
10
11
11
12
use function assert ;
12
13
13
14
class EntityManagerProvider implements DoctrineEntityManagerProvider
14
15
{
15
- public function __construct (private ManagerRegistry $ managerRegistry )
16
+ public function __construct (private Container $ container )
16
17
{
17
18
}
18
19
19
20
public function getDefaultManager (): EntityManagerInterface
20
21
{
21
- $ entityManager = $ this ->managerRegistry ->getManager ();
22
+ $ entityManager = $ this ->container -> make (ManagerRegistry::class) ->getManager ();
22
23
23
24
assert ($ entityManager instanceof EntityManagerInterface);
24
25
@@ -27,7 +28,7 @@ public function getDefaultManager(): EntityManagerInterface
27
28
28
29
public function getManager (string $ name ): EntityManagerInterface
29
30
{
30
- $ entityManager = $ this ->managerRegistry ->getManager ($ name );
31
+ $ entityManager = $ this ->container -> make (ManagerRegistry::class) ->getManager ($ name );
31
32
32
33
assert ($ entityManager instanceof EntityManagerInterface);
33
34
You can’t perform that action at this time.
0 commit comments