Hi everybody. Need help with a problem that drives me crazy:)
Suppose you have those model relations:
Offer HABTM Category
How would you build the find conditions to find all the categories
that have at least one offer. In the same time the Offer should be
Offer.enabled => 1. So find all the categories with at least one
enabled offer. The conditions to check in the offer model are several,
but once I can check for the enabled, I think I will be able to check
for any other field.
I could bind the habtm model to Category, but in this case I can't
check the Offer.enabled condition. Maybe somehow using containable?
I have the normal sql query, which I could use but I want to learn how
to do this in the cakephp way