File tree Expand file tree Collapse file tree 3 files changed +5
-0
lines changed
tests/Doctrine/ODM/MongoDB/Tests/Proxy/Factory Expand file tree Collapse file tree 3 files changed +5
-0
lines changed Original file line number Diff line number Diff line change 1818/** @internal */
1919class NativeLazyObjectFactory implements ProxyFactory
2020{
21+ /** @var WeakMap<object, bool>|null */
2122 private static ?WeakMap $ lazyObjects = null ;
2223
2324 public function __construct (
Original file line number Diff line number Diff line change @@ -3078,6 +3078,8 @@ public function initializeObject(object $obj): void
30783078 $ obj ->initializeProxy ();
30793079 } elseif ($ obj instanceof PersistentCollectionInterface) {
30803080 $ obj ->initialize ();
3081+ } elseif ($ this ->dm ->getConfiguration ()->isNativeLazyObjectsEnabled ()) {
3082+ $ this ->dm ->getClassMetadata ($ obj ::class)->getReflectionClass ()->initializeLazyObject ($ obj );
30813083 }
30823084 }
30833085
Original file line number Diff line number Diff line change @@ -89,6 +89,8 @@ public function testCreateProxyForDocumentWithUnmappedProperties(): void
8989 $ proxy ->__setInitialized (true );
9090 } elseif ($ proxy instanceof GhostObjectInterface) {
9191 $ proxy ->setProxyInitializer (null );
92+ } elseif ($ this ->dm ->getConfiguration ()->isNativeLazyObjectsEnabled ()) {
93+ $ this ->dm ->getClassMetadata ($ proxy ::class)->getReflectionClass ()->markLazyObjectAsInitialized ($ proxy );
9294 }
9395
9496 self ::assertSame ('bar ' , $ proxy ->foo );
You can’t perform that action at this time.
0 commit comments