title: Kohana 3 ORM: How to perform query with 2 many to many relationships
body: <p>I have a products model with 2 many to many relationships defined. </p>
  
  <pre><code>protected $_has_many = array
  (
  'foodcats' =&gt; array('model' =&gt; 'foodcat',   'through' =&gt; 'products_foodcats'),
  'foodgroups' =&gt; array('model' =&gt; 'foodgroup', 'through' =&gt; 'products_foodgroups')
  )
  </code></pre>
  
  <p>I need a query where I find products with a given foodcat id and a given foodgroup name.
  I know I can do the following to get all products with a given foodcat id</p>
  
  <pre><code>$foodcat = ORM::factory('foodcat',$foodCatId);
  $products = $foodcat-&gt;products-&gt;find_all();
  </code></pre>
  
  <p>But how do I query for products in that foodcat that also are in the foodgroup 'Entrees'?</p>
  
  <p>Thanks!</p>