J'ai un modèle qui a 2 association habtm.comment définir 2 habtm Association dans un modèle dans cakephp
mes modèles sont: 'Cours', 'Enseignant' et 'Étudiant.
cours hasAndBelongsToMany Enseignant et hasAndBelongsToMany Étudiant.
quand je codage comme ceci:
public $hasAndBelongsToMany = 'Student';
public $hasAndBelongsToMany = 'Teacher';
Ou:
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'
)
);
i voir erreur interne
Comment puis-je coder cela?
Merci
Le second semble bien, quelle erreur interne voyez-vous? – RichardAtHome
indique simplement: 'Erreur: une erreur interne s'est produite.' – Arman
Vérifiez le journal des erreurs de votre application /app/tmp/logs/error.log – RichardAtHome