Tuesday, October 27, 2009

Nested HABTM brainstorming / how to

Hi guys :)

I currently have a "products" table that HABTM "options". There is
also a "packages" table, which HABTM "products". So far so good. The
tricky thing is that when building packages, I want to *only* have
certain options available for each package.

Example:

Product 1 has Option A, Option B and Option C
Product 2 has Option C, Option D and Option F

I want to have a Package that will be made of Product 1 with Option A
plus Option B and Product 2 with Option C plus Option F, for example.
The way I have them set up now, adding Product 1 and Product 2 to the
Package will show them with all their options.

My idea would be to HABTM the link table for Packages_Products with
the Options table - but I'm not really sure how that will impact
performance and if the automagic of Cake will still work.

What are your suggestions on this matter?

Thanks in advance,

Razvan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: