I need to add products in a category, and for this I need to see all products that are NOT (already) IN that category
On Dec 17, 6:51 pm, cricket <[email protected]> wrote: > On Fri, Dec 17, 2010 at 3:32 AM, ionatan <[email protected]> wrote: > > Hello, I have a table products, a table categories and a table > > categories_products with category_id, product_id as foreign keys. > > > I need to make a paginator to display all products that not belong to > > the selected category. > > That seems a bit odd. But who am I to question what someone's client > wants? Most of us have had to do some pretty strange things, no doubt. > > Anyway, this should take care of it for you: > > 'conditions' => array( > 'NOT' => array( > 'Product.category_id' => $category_id > ) > ) > > > How I can do this with Cake? And in which controller? > > products_controller, or categories_products_controller ? > > Products would make more sense, I think, as you're paginating them. > But it could be done from either. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
