New Yii Project - help

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:

  1. 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?

  2. 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.

  1. 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.

We can’t help you unless you clearly understand what task do you solve.

I can only suggest you to take a piece of a paper and work it :)

P.S. You problem is not Yii-related now, it’s all about database design. But you need to have a good understanding of what do you want to store in it.

DB modelling should usually always be done, before you write the first line of code.

Maybe take an hour (or two) to study this example process:

http://www.agiledata.org/essays/agileDataModeling.html

I get the following error for my model called "Model" :

Fatal error: Constructor Model::model() cannot be static in C:\Users\Me\Documents\Web Sites\My Site\protected\models\Model.php on line 80

Line 80 is the last line (the closing bracket).