Msofts
Msofts

Reputation: 87

Can i give conditions in contain in cakephp 1.3

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

Answers (3)

Mosselman
Mosselman

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

Renjith Chacko
Renjith Chacko

Reputation: 1

Yes you can give conditions in contain

Upvotes: -2

openprojdevel
openprojdevel

Reputation: 182

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

Upvotes: 0

Related Questions