Hello everyone ,
I am using yii for the first time for my project, and I am stuck at some point…I will describe the problem and hope someone can give me an idea how to solve it. If you need my db structure or code please tell me.
The company offers trainings and each training can be of a specific process (only 2 until now: FB and DSM). So I have a table ‘trainings’ and a table ‘processes’. For each training there are some tasks to be done before and after the training (ex: print material, certificate, get feedback etc…so a list of checkboxes) The problem was that for each process, the tasks were different (mixed)! So I could not just make a table for ‘tasks before training’ and ‘tasks after training’…I read that this was called “Polymorphic Association“…anyway, I did 3 tables were one of them is called “process_constraint” used to connect table ‘processes’ with the 2 tasks tables, so eg. it assigns to process FB some of the attributes of table ‘tasks before training’ and so on…
The problem is this: When a training is created I also want an object of ‘tasks’ to be created, depending on the process the training is based on…but I can’t do it using gii since I don’t have only one table. Plus, I am confused how and where can I store the task list I want to generate (since it will be updated from time to time until all tasks are completed). I hope my explanation is clear enough. I want to know how can I solve it? I don’t even know where to start…
Thank you for your help