I have the following model classes:
class User extends AppModel {
var $name= 'User';
var $belongsTo=array('SellerType' => array('className' => 'SellerType'),
'State' => array('className' => 'State'),
'Country' => array('className' => 'Country'),
'AdvertMethod' => array('className' => 'AdvertMethod'),
'UserType' => array('className' => 'UserType'));
var $hasMany = array('UserQuery' => array('className' => 'UserQuery'));}
And:
class UserQuery extends AppModel {
var $name = 'UserQuery';
var $belongsTo = array('User', 'ResidenceType', 'HomeType');}
Everything works fine with the user class and all its associations, but the UserQuery class is being completely ignored by the orm (table name user_queries and the generated queries do cast it as UserQuery. Another weird thing is that if I delete the code inside the User class I get an error, but if I do the same for the UserQuery class I get no errors.
So my question is why does cakephp generate a class on the fly for the UserQuery and ignores my class, and why doesn't it generate a class on the fly for the User as well ?