[FLOW3-general] Many to Many Relation with Duplicates
Jeff Segars
jsegars at alumni.rice.edu
Thu Jan 19 18:27:57 CET 2012
On 1/10/12 3:13 AM, Karsten Dambekalns wrote:
> Hi Jeff& Christian.
>
> On 08.01.12 15:56, Jeff Segars wrote:
>>> as for the ManyToMany the described behaviour is correct, but doctrine
>>> shouldn't set a unique contraint on the columns so that multiple entries
>>> with the same keys should be possible and so quantities should be
>>> working. If not it's a bug for me (either in our implementation or in
>>> doctrine, that would have to be checked).
>>
>> Here's what I get as the primary key in all my MM tables. Note the
>> composite primary key...
>
> Yes, there are two unique instances and they are connected. You don't
> really want to have duplicate entries, but a count - which needs a
> container object. I think no one on the Doctrine side will agree on this
> being a bug.
Thanks. From what I could tell it was an intentional design decision
also but wanted to be sure I wasn't missing something.
> Think of it in terms of PHP code, how would you solve this? Would you
> really put 5 items into a basket, or would you use 1 and a count field?
As a lazy developer needing to use quantities in quite a few places, I
was hoping to put 5 items into a basket ;) Makes sense though...I've
updated my domain models and it seems to be working just fine. Thanks
for the insight!
Jeff
More information about the FLOW3-general
mailing list