鉴于以下内容: 内容模型
public $hasAndBelongsToMany = array(
'Tag' => array(
'className' => 'Tag',
'joinTable' => 'contents_tags',
'foreignKey' => 'content_id',
'associationForeignKey' => 'tag_id',
'unique' => 'keepExisting',
)
);
标记模型
public $hasAndBelongsToMany = array(
'Content' => array(
'className' => 'Content',
'joinTable' => 'contents_tags',
'foreignKey' => 'tag_id',
'associationForeignKey' => 'content_id',
'unique' => 'keepExisting',
)
);
预订模型
public $belongsTo = array(
'Content' => array(
'className' => 'Content',
'foreignKey' => 'content_id',
),
);
Book模型有content_id
。我怎样(如果可能的话)将图书模型与标签模型联系起来?