has many - Issue with belongsTo and hasMany in CakePHP -
i'm facing issue models. have controller 'jobapplications' linked 'history' model :
public $hasmany = array( 'history' => array( 'order' => array('history.created' => 'desc') ) );
'history' model contains multiple lines.
my history model has 'belongsto' line :
public $belongsto = array('status', 'user');
problem link 'status' , 'user' not made, don't have fields these tables.
do have idea ?
edit : manage using 'recursive' => 3 in controller, i'm getting fiels, it's not clean.
i try add :
'contain' => array( 'history' => array( 'status' => array('fields' => array('status.name')), 'user'=> array('fields' => array('user.username')), ), 'diploma', 'field', 'area' ),
and :
public $actsas = array('containable');
to other models, doesn't work.
Comments
Post a Comment