Tuesday, April 30, 2013

Re: Best way to set up this Relation

Hi Fernando,

an idea that it's up to you to try is implement a MovieParticipation Model.

Thus:
Celebrities hasMany MovieParticipation
Movies hasMany MovieParticipation

Where the MovieParticipation table might have following fields:
  • id
  • celebrity_id
  • movie_id 
  • as_actor
  • as_director
  • as_scriptwritter
Where these as_{participation} fields are just flags (on-off). Since in Hollywood there are some cases where the Director is an Actor too in his movie, this way could allow you to handle them by having more than one of these flags on.

Also, in this way, I think you won't be needing Actors, Directors and ScriptWritters Models and Controllers as separate stuff, just Celebrities.
Now that will depend on the other features and how the whole app is expected to work.

Regards,
Ciul

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: