値がIDの配列のIDと等しいIDを見つけるには:
$this->YourModel->find('all', array(
'conditions' => array(
"YourModel.id" => array(1, 2, 3, 4)
)
));
IDがIDの配列とは異なる要素を見つけるにはどうすればよいですか?
これはうまくいくはずです:
$this->YourModel->find('all', array(
'conditions' => array(
"NOT" => array( "YourModel.id" => array(1, 2, 3, 4) )
)
));
http://book.cakephp.org/2.0/en/models/retrieving-your-data.html#complex-find-conditions