File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
src/Doctrine/Orm/Metadata/Resource
Doctrine/Orm/Metadata/Resource
Fixtures/TestBundle/Doctrine/Orm Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -66,8 +66,16 @@ public function createLinksFromRelations(Metadata $operation): array
66
66
continue ;
67
67
}
68
68
69
+ if (!$ doctrineMetadata ->isAssociationInverseSide ($ property )) {
70
+ continue ;
71
+ }
72
+
73
+ if (!($ mappedBy = $ doctrineMetadata ->getAssociationMappedByTargetField ($ property ))) {
74
+ continue ;
75
+ }
76
+
69
77
$ relationClass = $ doctrineMetadata ->getAssociationTargetClass ($ property );
70
- if (!( $ mappedBy = $ doctrineMetadata -> getAssociationMappedByTargetField ( $ property )) || ! $ this ->resourceClassResolver ->isResourceClass ($ relationClass )) {
78
+ if (!$ this ->resourceClassResolver ->isResourceClass ($ relationClass )) {
71
79
continue ;
72
80
}
73
81
Original file line number Diff line number Diff line change @@ -51,6 +51,10 @@ public function testCreateLinksFromRelations(): void
51
51
$ classMetadataProphecy ->getAssociationMappedByTargetField ('relatedNonResource ' )->willReturn ('dummies ' );
52
52
$ classMetadataProphecy ->getAssociationMappedByTargetField ('relatedDummy ' )->willReturn (null );
53
53
$ classMetadataProphecy ->getAssociationMappedByTargetField ('relatedDummies ' )->willReturn ('dummies ' );
54
+ $ classMetadataProphecy ->isAssociationInverseSide ('relatedNonResource ' )->willReturn (true );
55
+ $ classMetadataProphecy ->isAssociationInverseSide ('relatedDummy ' )->willReturn (true );
56
+ $ classMetadataProphecy ->isAssociationInverseSide ('relatedDummies ' )->willReturn (true );
57
+
54
58
$ entityManagerProphecy = $ this ->prophesize (EntityManagerInterface::class);
55
59
$ entityManagerProphecy ->getClassMetadata ($ class )->willReturn ($ classMetadataProphecy ->reveal ());
56
60
$ managerRegistryProphecy = $ this ->prophesize (ManagerRegistry::class);
Original file line number Diff line number Diff line change @@ -45,4 +45,9 @@ public function createQuery($dql = ''): Query
45
45
46
46
return $ this ->wrapped ->createQuery ($ dql );
47
47
}
48
+
49
+ public function isUninitializedObject (mixed $ value ): bool
50
+ {
51
+ return true ;
52
+ }
48
53
}
You can’t perform that action at this time.
0 commit comments