tags:

views:

91

answers:

3

hi all, 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

A: 

isnt conditions in the format $this->ModelName->find('all',array('conditions'=>array('Table.name'=>1))); working for you?

openprojdevel
A: 

Yes you can give conditions in contain

Renjith Chacko
+1  A: 

$this->Post->find('all', array('contain' => array( 'Comment' => array( 'conditions' => array('Comment.author =' => "Daniel"), 'order' => 'Comment.created DESC' ) )));

You could always try the documentation first ;).

Mosselman