My questions revolves around the ‘best practice’ on creating controllers and models in the Yii framework.
My database is currently;
Billing (one-many) Site (one-many) Job (one-many) JobEntries (one-many) JobTime/JobItem/JobNote
Billing: is our client’s billing details, contains billing address, terms etc
Site: is our client’s physical site details and there can be multiple site addresses for a billable client
Job: contains the job header details for scheduled work we do for a client
JobEntries: is a table being used to tie multiple work entries we do to a particular job and ties time/item/notes to it.
The 3 tables JobTime, JobItem, JobNote each contain data for time, hardware sold, and notes per entry.
The database structure is designed so we can have multiple time, item, note entries per job entry, and multiple job entries for the job.
I currently have a controller called ClientController that manipulates the Billing and Site models and it works nicely. I read somewhere controller model was a 1:1. Is this correct? or am I doing aok in making a controller handle multiple models?
Reason I ask is I am about to code the JobController which will handle the Job, JobEntries, JobTime, JobItem, JobNote models.
Many thanks for your clarification guys!
Jason