following scenario:
Recipe hasMany RecipeItem
RecipeItem belongsTo Recipe, Ingredient
(Ingredient
could be associated with hasMany RecipeItem
, but I don't need that relation.)
so basically, a one sided HABTM without the join table, because my joining element (the RecipeItem
) needs to have an additional attribute: count.
This article: http://book.cakephp.org/1.3/view/1650/hasMany-through-The-Join-Model describes how to either create/save all at once or completely separated. What I want is to create the one side (the ingredients) separated and the other side (the recipes) together with the association. When creating a new recipe, you could choose multiple ingredients.
How would you do this? Thanks.