I'm really trying to understand CakePHP's naming conventions and the following isn't entirely intuitive to me.
Let's say I have two pieces of information:
videos - specific information about video
category - list of categories with id, title, description
How would I structure my tables? My first instinct is:
videos
categories
video_categories
Is this right?
It should be:
videoscategoriescategories_videos (plural model names in alphabetical order for HABTM)If your videos can only belong to one category, forgo the categories_videos table and just put a category_id field into the videos table.
http://book.cakephp.org/2.0/en/getting-started/cakephp-conventions.html#model-and-database-conventions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With