I have a query like this:
return $this->createQueryBuilder('supervision')
->join('supervision.supervisionEvents', 'supervisionEvents')
->andWhere('supervisionEvents.episode = :episode')
->setParameter('episode', $episode)
->getQuery()
->getResult()
;
I want to get all supervisions but the supervisionEvents I want to filter. In result I only want to have SupervisionEvents with episode = :episode.
I used join, leftJoin and innerJoin. Nothing works like desired.
I tried to have a condition on the join:
->innerJoin('s.supervisionEvents', 'supervisionEvent', 'WITH', 'supervisionEvent.episode = :episode')
But thats also not working!