I am learning that data manipulation needs to be done in the model. Fat Model, thin controller. Ok, so I'm trying to wrap my mind around something. Here's my example:
Let's assume these tables: people (id, name) events (id, name, day, time) events_people (event_id, person_id) So, people HABTM events. totally cool so far. Now, let's say that when viewing a person I want to see all of the events organized into time slots based on another table in the database: times (id, day, start, end) There's no relationship between events and times. It's just that I want the event that happens on Friday at 2pm to be displayed in the time slot that is Friday 1pm - 4pm, for example. The point is, somewhere I have to cycle through the times and then cycle through the events and see if the time of the event is between "start" and "end" so I know if it should be displayed there. I guess I need to do data logic like that in the model, but which model? Should I have a method in the person model in which I also grab the data from the time model and then return an array with all of the display data neatly packaged for the view? Maybe this is a confusing question. I think I'm just still trying to understand the cakePHP conventions. Any ideas would be greatly 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 [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 To unsubscribe, reply using "remove me" as the subject.
