I got the following DB schema:
Domains HABTM Categories
and the Categories Table has the TreeBehavior attached to it with data like
- Parent-Category 1
- Parent-Category 2
Now I would like to get all Domains which have
Parent-Category 1 => Name1set and
- have nothing set from any of the
Parent-Category 2Sub Categories (1 level is fine, not multiple levels down)
I know how I can get the first condition which is just a simple
->matching() but I am a bit stuck on the second.
Normally I would go for a
->notMatching() but I can’t combine those 2 together.
Is there an easy way to do that?