I am starting a new (personal) Yii Project for a website based on "Talents" - for example:
Models
Actors
Singers
Dancers
Musicians
Each of these talents will have it’s own table and includes a user_id field to map the record to a specific user.
Any user who signs up on the website can create a profile for one or more of these talents. My questions are:
How should I perform the lookups of the talents for each user? I.e. in the user table should there be fields for the ID of each talent? Or should I perform a lookup in each ‘talent’ table to see if that user_id exists in there?
Will there be any problem calling a table ‘model’? ($model=new Model)
Can a user have many singer talents, for example? What are differences between all these tables? Could be interesting to see tables’ structure and relations between them.
Yes, if you’ll want to create another class with the same name. All Yii classes are named using ‘C’ prefix.
Hmm good point. I suppose a talent can have multiple sub-talents (an actor can be a tv actor or a theatre actor or a voiceover actor).
I haven’t yet created the table structures to be honest. Are you proposing there should only be one “talent” table and then have a table that stores the talent types?
The only differences I suppose would be the attributes of each talent, for example a Model can specify what kind of genres they are interested in and what compensation they will accept (these would be checkbox list selections rather than free text value). An actor can specify details of what roles they have done in their career, I suppose this information would be stored in a link table though.