S
S
snugforce2014-02-04 13:49:07
Yii
snugforce, 2014-02-04 13:49:07

How to design an additional model?

Prehistory.
There is an already created project on yii filing applications for repair of equipment and commenting / changing the status of users (technicians). Accordingly tables (models) Call(id, category_id, group_id, title, txt,...) and Comment(id, call_id, txt,...). Applications are visible to everyone, including guests.
Now we need to add the ability to add Tasks to one or more users. Task(id, txt. user_id(who gave the task)). Auxiliary table user_task(id, user_id, task_id). And again, the creator and participants can comment on the task. Tasks are visible only to participants.
The question is how to do it.
1. The task is merged with the Application - all fields are in one table, the Comments table is one. Part of the presentations is one. In the Application (Task) controller, the division into types is its own list, different forms of adding.
2. The task is separate from the Application, its own model, its own controller, its own comments.
Everywhere has its pros and cons, opinions are divided) there was a stupor. What would be more correct and logical?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question