I have two models: Store
and Review
. Users of my site can leave a review on a store. In my database, I have a join table, reviews_stores
that associates a review with a store.
How do I link my models? I assume a Store
should haveMany Review
, and a Review
should belong to a Store
, but the join table is causing issues with CakePHP as CakePHP is assuming my reviews
table has a column called store_id
.
The reason I'm using a join table is because many parts of my site can be reviewed. For example, brands. A new Review
record will be created and a record will be inserted into a brands_reviews
table to associate the two records.
Any help would be much appreciated.