I understand how to do table relations in the model using the reference
property and such. I don't understand where and how I should do my views and
controlling of adding to this database. For example I have three tables
Bugs, Ratings, BugRatings. I make my three models one for each table. I add
bugs by making an action called createAction in the BugsController and a
form view. I can do the same thing for the ratings. I don't understand how,
if there is a standard way, I should add (attach) the rating to the bug. I
imagine that calling an action, such as listAction in BugsController would
make a list and have an option next to each entity to rate it. My idea to
accomplish this is when you submit your rating it calls createAction in the
BugRatingsController, which loads both the Ratings model and the BugRatings
model creates a new rating and then takes the last insert Id and the bug id
and creates a new entry in the BugRatings model.

Another example that kind of goes along with this is I have those same
tables plus a Tag model and a BugTags model. When I create a bug I want to
add tags to it at that time. My idea for this was to load the  BugTagModel
into the createAction of the BugModel and within the controller do the model
insert for the tags. This implies that BugTagModel loads Tag to create new
tags in the model, but not call the createController from bugModel. This
means though that any table I want to add tags to I have to do the code to
add a tag. Should I be make a call to the createAction in the TagController
from the BugTagsController and the createAction in BugsController to the
createAction in the BugTagsController?
-- 
View this message in context: 
http://www.nabble.com/Complex-Applications%3A-Controller-and-views-tf4531743s16154.html#a12932526
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to