5
5
use Doctrine \Common \Proxy \AbstractProxyFactory ;
6
6
use Doctrine \DBAL \Connection ;
7
7
use Doctrine \ORM \Configuration ;
8
- use Doctrine \ORM \Decorator \EntityManagerDecorator ;
9
8
use Doctrine \ORM \EntityManager as DoctrineEntityManager ;
10
9
use Doctrine \ORM \Mapping \UnderscoreNamingStrategy ;
11
10
use Doctrine \Persistence \Mapping \Driver \MappingDriverChain ;
12
11
use Nette \DI \Definitions \Statement ;
13
12
use Nette \DI \Helpers ;
14
13
use Nette \Schema \Expect ;
15
14
use Nette \Schema \Schema ;
15
+ use Nettrine \ORM \Decorator \SimpleEntityManagerDecorator ;
16
16
use Nettrine \ORM \DI \Definitions \SmartStatement ;
17
17
use Nettrine \ORM \Exception \Logical \InvalidArgumentException ;
18
18
use Nettrine \ORM \Exception \Logical \InvalidStateException ;
@@ -35,7 +35,7 @@ public function getConfigSchema(): Schema
35
35
$ proxyDir = isset ($ parameters ['tempDir ' ]) ? $ parameters ['tempDir ' ] . '/proxies ' : null ;
36
36
37
37
return Expect::structure ([
38
- 'entityManagerDecoratorClass ' => Expect::string (EntityManagerDecorator ::class),
38
+ 'entityManagerDecoratorClass ' => Expect::string (SimpleEntityManagerDecorator ::class),
39
39
'configurationClass ' => Expect::string (Configuration::class),
40
40
'configuration ' => Expect::structure ([
41
41
'proxyDir ' => Expect::string ($ proxyDir )->nullable (),
@@ -193,15 +193,16 @@ public function loadEntityManagerConfiguration(): void
193
193
194
194
// Manager Registry
195
195
$ builder ->addDefinition ($ this ->prefix ('managerRegistry ' ))
196
- ->setType (\Doctrine \Persistence \ManagerRegistry::class)
197
196
->setFactory (ManagerRegistry::class, [
198
- $ builder -> getDefinitionByType ( Connection::class) ,
197
+ ' @ ' . Connection::class,
199
198
$ this ->prefix ('@entityManagerDecorator ' ),
200
199
]);
201
200
202
201
// Manager Provider
203
202
$ builder ->addDefinition ($ this ->prefix ('managerProvider ' ))
204
- ->setFactory (ManagerProvider::class, [$ this ->prefix ('@managerRegistry ' )]);
203
+ ->setFactory (ManagerProvider::class, [
204
+ $ this ->prefix ('@managerRegistry ' ),
205
+ ]);
205
206
}
206
207
207
208
public function loadMappingConfiguration (): void
0 commit comments