Cake doesn't have an excellent way of doing this yet but grigri posted
this method the other day:
http://groups.google.com/group/cake-php/browse_thread/thread/863305f8a7267067
which is a lot better than writing out the SQL by hand.
quoted (grigri):
I know nothing about using MySQL views, but I
I have two associated models - Newproduct hasMany Newproductimage -
Ideally, I need to do a find that only returns the Newproductimage
where 'newproductimage.thumbnail' is set to 1
Doing:
$conditions = array('Newproductimage.thumbnail' => 1)
$this->Newproduct->find('all', array('conditions' => $