I\'m attempting to build a query in Doctrine 2 that finds all Vacancy entities which are related to any of the given VacancyWorkingHours entities.<
Vacancy
VacancyWorkingHours
Try to set IDs as parameter
$ids = array(); foreach($workingHours as $w) { $ids[] = $w->getId(); }
Then
$q = $this->createQueryBuilder('v') ->select('v') ->andWhere('v.workingHours IN (:workingHours)') ->setParameter('workingHours', $ids); ;