Ok I think I follow, just to clarify: A product will belong to at least one or more subcategories, so i guess it will be
product_sub_categories id product_id sub_category_id Im not too sure what you mean by the recursive parent_id.. can you please elaborate? Thanks Kevin On Jun 4, 3:02 pm, "David Coleman" <[email protected]> wrote: > This depends on how you want to build your sub categories tree: > > Is it a relationship like this: > > category > > id > > parent_id > > or > > category > > id > > sub_category > > id > > category_id > > parent_sub_category > > your product could be > > product > > id > > ... > > Then a join table > > categories_products > > id > > product_id > > category_id > > or you could have > > product > > id > > category_id > > product_sub_categories > > id > > product_id > > sub_category_id > > it really depends on what your data model requirements are. > > The join table will be extremely useful in establishing the HABTM > relationships you require. > > Cake bake will not automatically detect recursive parent_id as a category. > so you will have to define that manually. > > -----Original Message----- > From: [email protected] [mailto:[email protected]] On Behalf > > Of Beedge > Sent: 2009-06-04 10:46 > To: CakePHP > Subject: A little help needed on determining my model relation ships please > > Hi all, about to start on my first cake project. A straight forward e- > > commerce site. > > I am not used to having to visualise my database relationships so I > > was hoping for a little help. > > A product belongs in a category > > A product can be in many categories > > A Category has Sub categories > > Is this just a HABTM relationship between products and categories? > > I will be using tree behavior for my categories. > > Any comments on this or helpers? I would love to find a tutorial that > > covered this, but all I can really find is blog tutorials! > > Thanks in advance > > Kev > > > > image001.gif > < 1KViewDownload --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" 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?hl=en -~----------~----~----~----~------~----~------~--~---
