feat: automatically call adders for Doctrine collections#1104
Conversation
|
@nikophil I use this PR + While testing, it look likes the PR do:
In my mind, if the Entity:
But not:
|
|
@mpiot not sure to understand fully what you mean, but if an adder is present, I think it should be used in priority, because adder might add extra needed logic (like set the other side of the relation). This is, by the way, the default behavior of the property accessor (adder > setter > public prop), this seems to be kinda of a convention, so I don't think I will change this, unless this cause bugs |
|
@nikophil I’ll double check tomorrow but while testing it looks like in a similar case: If I use the B factory, it doesn’t do B->setA(), but: A->addB(). Strange behavior because I use the B factory, I’ll expect it use the setter, not the adder of the related entity. If I’m using the A factory, and define B classes, I’ll expect it use the adder: A->addB(). |
this makes sense indeed, maybe harder to do it than it seems, I don't know, don't hesitate to edit the code of this PR in another one |
(trying to) fix #1100