[FLOW3-general] Many to Many Relation with Duplicates

"Christian Müller (Kitsunet)" christian.mueller at typo3.org
Mon Jan 9 17:20:43 CET 2012


Hey Jeff,

looks like it is really like that in doctrine even if documentation 
hints otherwise. Maybe you could check in our #flow3 irc channel if you 
find beberlei there, he is our contact person from the doctrine project. 
I will see to ask him too.

Cheers,
Christian

On 08/01/12 15:56, Jeff Segars wrote:
> Hey Christian,
> Thanks for the quick followup!
>
>> 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...
>
> CREATE TABLE
> `com_motorstarters_products_domain_model_compone_2fbde_parts_join` (
> `products_component_assembledcomponent` varchar(40) NOT NULL,
> `products_component_part` varchar(40) NOT NULL,
> PRIMARY KEY
> (`products_component_assembledcomponent`,`products_component_part`),
> KEY `IDX_48C9AD46144ABAE3` (`products_component_assembledcomponent`),
> KEY `IDX_48C9AD46ABC03757` (`products_component_part`),
> CONSTRAINT `FK_48C9AD46144ABAE3` FOREIGN KEY
> (`products_component_assembledcomponent`) REFERENCES
> `com_motorstarters_products_domain_model_component`
> (`flow3_persistence_identifier`),
> CONSTRAINT `FK_48C9AD46ABC03757` FOREIGN KEY (`products_component_part`)
> REFERENCES `com_motorstarters_products_domain_model_component_part`
> (`flow3_persistence_identifier`)
> ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
>
>
> Even when I manually change the key and insert a duplicate into the
> database, Doctrine still retrieves only unique parts in the collection.
>
> Is there something I'm missing? From what I can tell, its a design
> decision in Doctrine that just needs to be worked around.
>
> Thanks,
> jeff



More information about the FLOW3-general mailing list