Reputation: 87
i m facing some problem in find function. im fetching value fro find function.i have model.contian another model . Can i give conditions in contain in cakephp
is it possiblehi
Upvotes: 0
Views: 2882
Reputation: 1748
$this->Post->find('all', array('contain' => array(
'Comment' => array(
'conditions' => array('Comment.author =' => "Daniel"),
'order' => 'Comment.created DESC'
)
)));
You should always try the documentation first :).
Upvotes: 3
Reputation: 182
isnt conditions in the format $this->ModelName->find('all',array('conditions'=>array('Table.name'=>1))); working for you?
Upvotes: 0