File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 44
55use Doctrine \ORM \EntityManager ;
66use Doctrine \Persistence \AbstractManagerRegistry ;
7+ use Doctrine \Persistence \ObjectManagerDecorator ;
78use Doctrine \Persistence \Proxy ;
89use Nette \DI \Container ;
910use Nettrine \ORM \Utils \Binder ;
@@ -45,9 +46,17 @@ protected function resetService(string $name): void
4546 $ manager = $ this ->container ->getService ($ name );
4647
4748 Binder::use ($ manager , function (): void {
48- /** @var EntityManager $this */
49- $ this ->closed = false ; // @phpstan-ignore-line
49+ if ($ this instanceof EntityManager) { // @phpstan-ignore-line
50+ $ this ->closed = false ;
51+ } elseif ($ this instanceof ObjectManagerDecorator) { // @phpstan-ignore-line
52+ Binder::use ($ this ->wrapped , function (): void {
53+ if ($ this instanceof EntityManager) {// @phpstan-ignore-line
54+ $ this ->closed = false ;
55+ }
56+ });
57+ }
5058 });
59+ //throw new \Exception($manager::class);
5160
5261 $ this ->container ->removeService ($ name );
5362 }
You can’t perform that action at this time.
0 commit comments