File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
tests/Doctrine/Tests/ODM/PHPCR/Decorator Expand file tree Collapse file tree 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
242242 {
243243 return $ this ->wrapped ->getDocumentId ($ document );
244244 }
245+
246+ public function isUninitializedObject (mixed $ value ): bool
247+ {
248+ return $ this ->wrapped ->isUninitializedObject ($ value );
249+ }
245250}
Original file line number Diff line number Diff line change 1919use Doctrine \ODM \PHPCR \Translation \TranslationStrategy \ChildTranslationStrategy ;
2020use Doctrine \ODM \PHPCR \Translation \TranslationStrategy \TranslationStrategyInterface ;
2121use Doctrine \Persistence \ObjectRepository ;
22+ use Doctrine \Persistence \Proxy ;
2223use PHPCR \ItemNotFoundException ;
2324use PHPCR \NodeInterface ;
2425use PHPCR \PathNotFoundException ;
@@ -656,4 +657,9 @@ public function getDocumentId(object $document): ?string
656657 {
657658 return $ this ->unitOfWork ->getDocumentId ($ document );
658659 }
660+
661+ public function isUninitializedObject (mixed $ value ): bool
662+ {
663+ return $ value instanceof Proxy && !$ value ->__isInitialized ();
664+ }
659665}
Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ public function testCheckIfAllPublicMethodsAreDecorated(): void
1919 sort ($ dmMethods );
2020
2121 $ 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+ }
2325 sort ($ dmiMethods );
2426
2527 $ dmdMethods = get_class_methods (OwnDocumentManager::class);
You can’t perform that action at this time.
0 commit comments