File tree 3 files changed +14
-1
lines changed
tests/Doctrine/Tests/ODM/PHPCR/Decorator
3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -242,4 +242,9 @@ public function getDocumentId(object $document): string
242
242
{
243
243
return $ this ->wrapped ->getDocumentId ($ document );
244
244
}
245
+
246
+ public function isUninitializedObject (mixed $ value ): bool
247
+ {
248
+ return $ this ->wrapped ->isUninitializedObject ($ value );
249
+ }
245
250
}
Original file line number Diff line number Diff line change 19
19
use Doctrine \ODM \PHPCR \Translation \TranslationStrategy \ChildTranslationStrategy ;
20
20
use Doctrine \ODM \PHPCR \Translation \TranslationStrategy \TranslationStrategyInterface ;
21
21
use Doctrine \Persistence \ObjectRepository ;
22
+ use Doctrine \Persistence \Proxy ;
22
23
use PHPCR \ItemNotFoundException ;
23
24
use PHPCR \NodeInterface ;
24
25
use PHPCR \PathNotFoundException ;
@@ -656,4 +657,9 @@ public function getDocumentId(object $document): ?string
656
657
{
657
658
return $ this ->unitOfWork ->getDocumentId ($ document );
658
659
}
660
+
661
+ public function isUninitializedObject (mixed $ value ): bool
662
+ {
663
+ return $ value instanceof Proxy && !$ value ->__isInitialized ();
664
+ }
659
665
}
Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ public function testCheckIfAllPublicMethodsAreDecorated(): void
19
19
sort ($ dmMethods );
20
20
21
21
$ dmiMethods = get_class_methods (DocumentManagerInterface::class);
22
- $ dmiMethods = array_diff ($ dmiMethods , ['__construct ' ]);
22
+ if (!in_array ('isUninitializedObject ' , $ dmiMethods )) {
23
+ $ dmiMethods [] = 'isUninitializedObject ' ; // this method will only be added i ORM 4.*
24
+ }
23
25
sort ($ dmiMethods );
24
26
25
27
$ dmdMethods = get_class_methods (OwnDocumentManager::class);
You can’t perform that action at this time.
0 commit comments