title: Cakephp pagination on recursive conditions
body: <p>I am going mad on this issue please somebody help me :)</p>
  
  <p>I have this models:</p>
  
  <p>Order hasMany--> Orderitem hasOne--> Product</p>
  
  <p>Product has field vendor_id.</p>
  
  <p>I would like to paginate orders wich have products with a particular vendor_id.</p>
  
  <p>How I could achieve this?</p>
  
  <p>My code in the orders_controller:</p>
  
  <pre><code>if(!empty($this-&gt;data['Order']['vendor_id'])) {
      $conditions['Product.vendor_id']=$this-&gt;data['Order']['vendor_id'];
  }
  if(!empty($this-&gt;data['Order']['startdate'])) {
      $conditions['Order.date &gt;=']=$this-&gt;data['Order']['startdate'];
  }
  if(!empty($this-&gt;data['Order']['enddate'])) {
      $conditions['Order.date &lt;=']=$this-&gt;data['Order']['enddate'];
  }
  $this-&gt;paginate=array('conditions'=&gt;$conditions,'order'=&gt;'Order.id ASC');
  </code></pre>
  
  <p>It gives Unknown column 'Product.vendor_id' in 'where clause' error.
  I've tried several things with Containable but without a success :(</p>