Allow to add JoinTable and InverseJoinColunm ORM attributes #1318
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposition : Allow to add JoinTable attribute on ManyToMany relations and InverseJoinColumn attribute on ManyToMany, ManyToOne and OneToOne relations
Points of attention :
Point 1 : Other attributes can be added. It may be preferable to only allow a whitelist with JoinTable and InverseJoinColumn instead.
Point 2 : It's not be possible to override attributes added added by the manipulator, for example, the JoinColumn on ManyToOne and OneToOne for non-nullable owning relation. Maybe it should be more permissive.
Point 3 : the attributes array becomes indexed by string (the mapping class) to not allow the same attribute multiple time, it's set back to numerical indexes before the addProperty as before. Maybe it should be more permissive if some mapping attributes may appear multiple time on the same class attribute ?
Point 4 : test only cover my initial need : adding JoinTable and InverseJoinColumn on ManyToMany relation, not InverseJoinColumn on ManyToOne and OneToOne. But tests cover that JoinTable can't be used on others relations than ManyToMany and that InverseJoinColumn can't be used on OneToMany. Tests also cover that a relation mapping can't be added as additionnal attribute on itself (for example, adding ManyToMany additionnal attribute on a RelationManyToMany)
Related issue : #1316