views:

21

answers:

1

Hi, I got 3 tables (Accessories, User, Accesories_Users)... At Accessories_Controller im trying just to get the accessories from the user logged in, so i set the recursive=1 and then execute the find...

The problem is, if i do

$this->Accessory->find("All", array('conditions'=>array('AccessoriesUser.user_id'=>$this->Auth->User('id'), 'AccessoriesUser.Accesory_id'=>'Accessory.id')));

theres an error cus it doesnt find Accessory_id field.... I could manage this using a custom query but is not the idea... And then even if i do the custom query solution i cannot paginate the array that the query return...

Thanks in advance for any help you can give me...

A: 

just use var $paginate = array('conditions'=>array()) and for habtm relations $this->model->bindModel('hasOne'=>aaray('otherModel'));

juan