I have an issue with cakephp find method when apply a condition on a related model. Here is my scenario
Machine belongsTo Category
Machine hasAndBelongsToMany Products
(products produced by machines)
Now I want all those categories with machines that hasandbelongs to a particular product.
i.e the result set should be like the following array!
Category 1
Machine 1 (that can produce for example product1)
machine 2 (that can produce product 1)
Category 2
machine 3 (that can produce product 1)
machine 4 (that can produce product 1)
I have tried the containable behavior and joins but no luck.