Closed mringler closed 10 months ago
Patch coverage: 100.00
% and project coverage change: +0.69
:tada:
Comparison is base (
011aaa7
) 88.56% compared to head (2e9e80f
) 89.25%.
:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Fixes #941
When you have three FKs on a cross-reference table, Propel will generate methods on the referenced tables, where the name uses a combination of the other two FKs. For example, if a cross-reference table has three FKs to the tables
A
,B
andC
, Propel generates a methodclearABs()
on tableC
. The methods areclear*
,init*
,get*
,set*
,count*
,doAdd*
andremove*
.This produces collisions when the name of the cross-reference table is a combination of the names of two of the referenced tables. In above example, that would happen when the cross-reference table is named
AB
. (Somewhat unfortunately, this is the name suggested in the documentation. In this case, Propel adds some methods with the same name, once where it handles the cross-reference table (clearABs
to clear associated elements in the cross ref table), and once again where it handles the tables connected by the cross-reference table (clearABs
to clear associated As and Bs). This leads to an exception.The name for the cross-ref relations is generated in
AbstractOmBuilder::getCrossFKsPhpNameAffix()
, this change tests whether the current table has a FK relation to another table with the same name, and if so, prefixes the relation name withCross
. The above method would then be calledclearCrossABs()
.From what I can see, this only affects names that could not occur before because of the error, so I don't think this affects BC.