Hello experts!

Let's say there are many women in my life (ha!) and depending upon the
time, they might have different moods. This cannot be a simple HABTM
relationship because I want a value associated with the join table, so
I have defined the models like this:

Woman hasMany Mood
Time hasMany Mood
Mood belongsTo Woman, Time

The db would be something like:

Women {id, name}
Times {id, name}
Moods {id, woman_id, time_id, mood}  <--- by the way, is "mood" an ok
field name in the "moods" table, or should it be "name"?

Good so far?

Now, let's say in my view I just want to draw a table with Women
across the top (wife, daughter, etc...) and Times along the left side
(Morning, Afternoon, When I Forget A Birthday, etc...). Ideally I'd
want to just cycle through the times (creating table rows), and then
within each row, get each woman's mood for that time. Of course, the
first row will be the names of the women, and the first <td> of each
row will be the time.

It seems like a simple (and probably common) relationship, but I'm
having trouble seeing the clean and efficient way to set that array in
the controller.

Your thoughts are much appreciated!
Thanks,
Jason

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+unsubscr...@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.

Reply via email to