File tree 2 files changed +15
-0
lines changed
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 1
1
# Upgrade to 2.15
2
2
3
+ ## Deprecated configuring ` JoinColumn ` on the inverse side of one-to-one associations
4
+
5
+ For one-to-one associations, the side using the ` mappedBy ` attribute is the inverse side.
6
+ The owning side is the entity with the table containing the foreign key. Using ` JoinColumn `
7
+ configuration on the _ inverse_ side now triggers a deprecation notice and will be an error
8
+ in 3.0.
9
+
3
10
## Deprecated overriding fields or associations not declared in mapped superclasses
4
11
5
12
As stated in the documentation, fields and associations may only be overridden when being inherited
Original file line number Diff line number Diff line change @@ -1864,6 +1864,14 @@ protected function _validateAndCompleteOneToOneMapping(array $mapping)
1864
1864
{
1865
1865
$ mapping = $ this ->_validateAndCompleteAssociationMapping ($ mapping );
1866
1866
1867
+ if (isset ($ mapping ['joinColumns ' ]) && $ mapping ['joinColumns ' ] && ! $ mapping ['isOwningSide ' ]) {
1868
+ Deprecation::trigger (
1869
+ 'doctrine/orm ' ,
1870
+ 'https://github.com/doctrine/orm/pull/10654 ' ,
1871
+ 'JoinColumn configuration is not allowed on the inverse side of one-to-one associations, and will throw a MappingException in Doctrine ORM 3.0 '
1872
+ );
1873
+ }
1874
+
1867
1875
if (isset ($ mapping ['joinColumns ' ]) && $ mapping ['joinColumns ' ]) {
1868
1876
$ mapping ['isOwningSide ' ] = true ;
1869
1877
}
You can’t perform that action at this time.
0 commit comments