I have a product model with 2 many many relationships.
protected $_has_many = array ( 'foodcats' => array('model' => 'foodcat', 'through' => 'products_foodcats'), 'foodgroups' => array('model' => 'foodgroup', 'through' => 'products_foodgroups') )
I need a request where I find products with the specified foodcat identifier and the name of this food group. I know I can do the following to get all products with a given foodcat id
$foodcat = ORM::factory('foodcat',$foodCatId); $products = $foodcat->products->find_all();
But how can I request products in this food package that are also in the "Entrees" food group?
Thanks!
source share