@@ -128,10 +128,14 @@ class Configuration
128128
129129 private ?CacheItemPoolInterface $ metadataCache = null ;
130130
131+ /** @deprecated */
132+ private ProxyManagerConfiguration $ proxyManagerConfiguration ;
133+
131134 private bool $ useTransactionalFlush = false ;
132135
133136 private bool $ useLazyGhostObject = true ;
134137
138+
135139 /**
136140 * Adds a namespace under a certain alias.
137141 */
@@ -256,6 +260,7 @@ public function setMetadataCache(CacheItemPoolInterface $cache): void
256260 public function setProxyDir (string $ dir ): void
257261 {
258262 $ this ->attributes ['proxyDir ' ] = $ dir ;
263+ unset($ this ->proxyManagerConfiguration );
259264 }
260265
261266 /**
@@ -288,6 +293,7 @@ public function getAutoGenerateProxyClasses(): int
288293 public function setAutoGenerateProxyClasses (int $ mode ): void
289294 {
290295 $ this ->attributes ['autoGenerateProxyClasses ' ] = $ mode ;
296+ unset($ this ->proxyManagerConfiguration );
291297 }
292298
293299 public function getProxyNamespace (): ?string
@@ -298,6 +304,7 @@ public function getProxyNamespace(): ?string
298304 public function setProxyNamespace (string $ ns ): void
299305 {
300306 $ this ->attributes ['proxyNamespace ' ] = $ ns ;
307+ unset($ this ->proxyManagerConfiguration );
301308 }
302309
303310 public function setHydratorDir (string $ dir ): void
@@ -586,6 +593,10 @@ public function buildGhostObjectFactory(): LazyLoadingGhostFactory
586593 /** @deprecated */
587594 public function getProxyManagerConfiguration (): ProxyManagerConfiguration
588595 {
596+ if (isset ($ this ->proxyManagerConfiguration )) {
597+ return $ this ->proxyManagerConfiguration ;
598+ }
599+
589600 $ proxyManagerConfiguration = new ProxyManagerConfiguration ();
590601 $ proxyManagerConfiguration ->setProxiesTargetDir ($ this ->getProxyDir ());
591602 $ proxyManagerConfiguration ->setProxiesNamespace ($ this ->getProxyNamespace ());
@@ -605,7 +616,7 @@ public function getProxyManagerConfiguration(): ProxyManagerConfiguration
605616 throw new InvalidArgumentException ('Invalid proxy generation strategy given - only AUTOGENERATE_FILE_NOT_EXISTS and AUTOGENERATE_EVAL are supported. ' );
606617 }
607618
608- return $ proxyManagerConfiguration ;
619+ return $ this -> proxyManagerConfiguration = $ proxyManagerConfiguration ;
609620 }
610621
611622 public function setUseTransactionalFlush (bool $ useTransactionalFlush ): void
0 commit comments