[eluser]Dushan[/eluser]
I would like to get some opinions on what people use models and helpers for in these scenarios.
1. Do you use models ONLY as an interface with the database (select, insert, update, delete). If so, where do you put functions that manipulate database outputs: controllers, helpers...?
2. Do you have other functions that perhaps manipulate the data in models too?
3. Do you create a single model for each table? If so, do you join data by processing multiple model outputs in PHP? If so, would you do that in the controller, one of the models (if so how do you choose), or a helper function?
4. Do you alternately have models that work with multiple tables (expl. user, userInvoice, and invoice tables and call the model something like user_invoices)?
Right now I have a model called 'user' that runs queries for users, but also joins a lot of other tables to get relevant user data. That model also does some of the processing of the data it returns too. It's a bit messy. My controllers are clean, but it's hard to to know exactly what belongs to what model and where do functions for model data go.
Many thanks in advance!!!