sasori
(Nemo Md5)
1
Hi,
I have a menu, it’s hard coded it contains about 8 menus.
under each should show the list of products available.
I have a products table. Actually it has a crud already,
only an admin can create products.
Problem: when I create a product, system doesn’t know to which
menu should the product fall under.
I need help/suggestions/tips how to design the next table that I should create
in order to link the proper product to the correct menu
e.g product can fall under 1 or 2 or 3 or many menus.
and also the Yii relations array for this ?
Thanks in advance 
zaccaria
(Matteo Falsitta)
2
You should create a many many relation menu-product, with a table for save the primary key pairs
sasori
(Nemo Md5)
3
let’s say I create a table named menu_category,
-
do I need to create a model for that?
-
how should I do the relation ?
-
should I do the relationship in the Product model like e.g
'menu' => array(self::MANY_MANY, 'Menu_category', 'menu_category(menuid,productid)')
is that snippet i pasted has the correct logic in it?
am a bit confused 