CakePHP's association model doesn't work
I designed a DB similar to the image, but I wrote the code for the association of the Model as follows, but I cannot access the stoc_wish and ctos_wish models from the Student model.
Please tell me how to solve it
//student.php
class Student extensions AppModel {
public$belongsTo=array('Team');
public$hasMany=array('Stoc_wish', 'Ctos_wish');
}
// stoc_wish.php
classStoc_wish extensions AppModel {
public$belongsTo=array('Student','Cuser');
}
// ctos_wish.php
class Ctos_wish extensions AppModel {
public$belongsTo=array('Student','Cuser');
}
Resolved
Invalid naming convention
The correct answer was StocWish, CtosWish
© 2024 OneMinuteCode. All rights reserved.