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 77use Doctrine \ORM \EntityManagerInterface ;
88use Doctrine \ORM \Tools \Console \EntityManagerProvider as DoctrineEntityManagerProvider ;
99use Doctrine \Persistence \ManagerRegistry ;
10+ use Illuminate \Contracts \Container \Container ;
1011
1112use function assert ;
1213
1314class EntityManagerProvider implements DoctrineEntityManagerProvider
1415{
15- public function __construct (private ManagerRegistry $ managerRegistry )
16+ public function __construct (private Container $ container )
1617 {
1718 }
1819
1920 public function getDefaultManager (): EntityManagerInterface
2021 {
21- $ entityManager = $ this ->managerRegistry ->getManager ();
22+ $ entityManager = $ this ->container -> make (ManagerRegistry::class) ->getManager ();
2223
2324 assert ($ entityManager instanceof EntityManagerInterface);
2425
@@ -27,7 +28,7 @@ public function getDefaultManager(): EntityManagerInterface
2728
2829 public function getManager (string $ name ): EntityManagerInterface
2930 {
30- $ entityManager = $ this ->managerRegistry ->getManager ($ name );
31+ $ entityManager = $ this ->container -> make (ManagerRegistry::class) ->getManager ($ name );
3132
3233 assert ($ entityManager instanceof EntityManagerInterface);
3334
You can’t perform that action at this time.
0 commit comments