Hi all,
I got a table with a few columns.
The table has a primary key (replyid), and two foreigne keys (userid and postid).
Here is the structure of the table: {replyid, content, userid, postid}
The Reply table got two foreigne keys.
I am not sure if this is a correct to set the foreign keys like this:
class Post extends AppModel{
var $name = 'Post';
var $useTable = 'post';
var $primaryKey = 'postid';
var $belongsTo = 'User';
var $hasMany = array(
'Reply' => array(
'className' => 'Reply',
'foreignKey' => 'postid',
'foreignKey' => 'userid'
)
);
}
?>
Could you helpplease?