You'll have three tables. If you're following CakePHP table naming conventions, you'll probably call them users
, offers_users
and offers
. In this case, you're probably looking to use a hasAndBelongsToMany relationship (HABTM). Basic example
class User extends AppModel {
public $hasAndBelongsToMany = array(
'Offer' =>
array(
'className' => 'Offer',
'joinTable' => 'offers_users',
'foreignKey' => 'user_id',
'associationForeignKey' => 'offer_id',
'unique' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'finderQuery' => '',
'with' => ''
)
);
}