Reputation: 45
Will the given below code can work where Mark
and Subject
are two model with which Student
model associate through hasMany
association
class Student extends AppModel
{
public $name = 'Student';
var $hasMany = array(
'Mark' => array(
'className' => 'Mark',
'foreignKey' => 'student_id'
),
'Subject' => array(
'className' => 'Subject',
'foreignKey' => 'student_id'
)
);
}
Upvotes: 0
Views: 508
Reputation: 2470
yes you can relationship with many tables
http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html
Find conditions with hasMany model
Upvotes: 1