How would I represent the following in a CakePHP model?
Product
=======
product_id
....
Cart
====
cart_id
....
Carts_Products
==============
cart_id
product_id
quantity
How would I represent the following in a CakePHP model?
Product
=======
product_id
....
Cart
====
cart_id
....
Carts_Products
==============
cart_id
product_id
quantity
I believe the answer to your question will be revealed on careful reading of this documentation page.
Since you are storing data in your join table (for a HABTM relation), you're situation looks quite similar to Rail's 'through' relation (seen at the bottom of this diagram). As such, you will want to create a model for that table and use Cake's 'with' relation setting seen on the HABTM page of the book. You should then be able to access the data stored on the join table. By convention...
products
, carts
, carts_products
Product
, Cart
, CartsProduct