2 つの habtm 関連付けを持つモデルがあります。
私のモデルは、「コース」、「教師」、「学生」です。
コース hasAndBelongsToMany Teacher と hasAndBelongsToMany Student です。
私がこのようにコーディングするとき:
public $hasAndBelongsToMany = 'Student';
public $hasAndBelongsToMany = 'Teacher';
または:
public $hasAndBelongsToMany = array(
'Student' => array(
'className' => 'Student',
'joinTable' => 'courses_students',
'foreignKey'=> 'course_id',
'associationForeignKey' => 'student_id'
),
'Teacher' => array(
'className' => 'Teacher',
'joinTable' => 'courses_teachers',
'foreignKey'=> 'course_id',
'associationForeignKey' => 'teacher_id'
)
);
内部エラーが表示されます
これをどのようにコーディングできますか?
ありがとう