I have ClassA with a ManyToMany relationship to ClassB, is there a way to Select ClassA entities by ClassB array? Currently I have:
$query = $em->createQuery("
SELECT a FROM Bundle:ClassA a
JOIN a.classB b
WHERE b IN (:classBEntities)
")
->setParameter('classBEntities', $classBEntities);
Being $classBEntities an array of ClassB entities. The problem with that query is that if I'm looking the ClassA entity that have ClassB entities 1, 2 and 3 it returns any ClassA entity that have one of those 3 ClassB entity as well as the one that have the three of them, but I need to select just the ones that have all the entities that the array contains.