I need some help as I seem not to be able to grasp the concept.
In a framework, namely Yii, we create models that correspond to database tables. We extend them from CActiveRecord.
However, if I want to create a class that will get some data from other models but then will do all the computations based on those results and do something with them... then how do I proceed?
I want to clearly divide the responsibility so I don't want put all the calculations in source db based models. Basically the idea is that it will be taking some stuff from some models and then updating another models with the results of the calculations.
What do I do?
- Keep all the calculations in some controller and use required models? (Hesitant about this because there is a rule to keep controller slim)
- Create a none db model and then work from there (how?)?
- Do something else (what?)?
Thanks for any help!