[FLOW3-general] Many to Many Relation with Duplicates

Jeff Segars jsegars at alumni.rice.edu
Sun Jan 8 00:59:49 CET 2012


Hey guys,
I've been working on my first FLOW3 application and have run into an 
issue with many to many relations.

My application has products that are built from several different types 
of parts. A single part may be used multiple times within a product and 
on multiple products, which means we need a many to many relation with 
the ability to have duplicate records within that relation (ie. 
quantities of a part).

Doctrine does not seem to support this idea (it sets the primary key on 
the MM table to both relations) and the normal way of working around 
this seems to be creating an intermediate class that mimics the MM 
behavior but is an entity itself. (see [1] for an example)

This approach works just fine, but it means I need unique classes every 
time I have a relation involving parts (ex. ProductPartReference, 
OrderPartReference, etc). It also means that anytime I assign parts from 
a Fluid form, my controller action needs to be initialized to allow 
object creation for subproperties. Neither of these are difficult, but 
when I'm doing it for many relations throughout the application it adds up.

Is there something I'm missing on the FLOW3 side of things that might 
let me work around this more effectively?

Thanks!
Jeff

[1] 
http://stackoverflow.com/questions/3542243/doctrine2-best-way-to-handle-many-to-many-with-extra-columns-in-reference-table


More information about the FLOW3-general mailing list