I've done some searching and can't quite seem to find what I'm looking
for. I have an existing php app that I've inherited that I'd like to
migrate to CakePHP. The problem I'm running into is that this app is
driven by a single un-normalized table...definitely not a db structure
that works well with Cake out of the box. What I'd like to know is the
best way to approach setting up my models for this type of situation.
Here are some of the fields in the table (named "Prices"):
id (int), category (varchar), item (varchar), brand (varchar), store
(varchar), price, size, etc ...
As it stands, I can obviously just use the "Prices" table as is and
have a single "Price" model in my app with all of the above fields. In
a perfect world, however, I'd like to be able to split everything into
several more logical models (i.e. Category, Brand, Store, etc), each
with the appropriate relationships (i.e. Category has many Products)
as well as refer to the main record as "Product" instead of the
default table name/model of "Price".
Is this type of customized table/model mapping possible in Cake? Am I
better off just sticking with a single "Price" model? Thanks in
advance for any direction you can provide!
-Brian
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
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
To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
No comments:
Post a Comment