当我尝试:
// Removed the limit to ensure that all of the group notes items can be found and collapsed
$recent_notes = $this->User->Note->find('all', array(
'recursive' => 2,
'order' => 'Note.created DESC',
'conditions' => $conditions,
'contains' => array(
'NotesUser', 'Poster', 'Comment' => array('Poster')
)
));
它不会限制输出 - 我得到每个相关的模型。但是,当我没有指定recursive
为2
时,或者如果我将其指定为1
,我就错过了Comment=>Poster
模型。
我怎样才能只得到我需要的模型?谢谢!