I have two classes in this example - DeliveryMethod and Country. They have a many-to-many relationship with each other.
What I want to do is select all DeliveryMetho
There is no need in joins and havings. Simply use SIZE function:
SIZE
$qb->select('m') ->from('DeliveryMethods','m') ->where('SIZE(m.countries) = 0');
This will give you all methods without attached countries