> Well I am much interested in how you would change my database! If I
> have understood you correctly this is what should be done:

This is kinda out of the scope of Cake discussion, but a crude entity
diagram would be:

raw_materials >-< ingredients (Many raw materials to many ingredients)
ingredients >-< recipies (Many ingredients to many recipies)

so your tables are:

ingredients (id, name, etc)
raw_materials (id, name, cost, etc)
ingredients_raw_materials (ingredient_id, raw_material_id, quantity)
recipies (id, name, etc)
ingredients_recipies (recipe_id, ingredient_id)

(At least I think that's how the cake naming conventions are - you can
read the 'Cake Conventions' section in the manual for the actual
rules)

> So how do I set up my recipe model?

You would have three models - Recipe, Ingredient and RawMaterial. This
is all explained in the URL I sent you earlier -
http://manual.cakephp.org/chapter/models

On that page, look under 'Associations', and specifically
'hasAndBelongsToMany' to find out how to relate (and retrieve) the
models.
-- 
Best,
Irfan Baig

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to