Saturday, February 28, 2009

Problem with various content structure

Hi.

I need some help with the structure of my project:

I have a table of "places" and a table of "guides". Each "guide"
belongs to a "place". So far, so ok.

The problem is that there are three types of "guides" which are stored
in three tables.

For example:
table "type1": id, title, text1, text2, text3, text4, text5
table "type2": id, title, text6, text 7
table "type3": id, title, text8, text9, text10

That's why I cannot solve it this way: table "guides": id, title,
description, type_id
Because the IDs of the guides repeat.

Now I tried to store the "type" in the table "guides": id, title,
description, type, type_id
But how can I find() the right information for my "guide" now?

Kinda like this?
$this->set('fields', $this->Guide->$type->find(all, array('conditions'
=> '$type.id = $type_id')));


Thank you for any help!

Fox

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

No comments: