Created
May 4, 2015 19:19
-
-
Save jschroed91/cc24cedc35373d1351cf to your computer and use it in GitHub Desktop.
Sub query example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$subQuery = $this->getEntityManager()->createQueryBuilder(); | |
$subQuery->select('relatedBallot.id') | |
->from('ProposalBundle:FloorModifiedProposal', 'floorModifiedProposal') | |
->join('floorModifiedProposal.ballotsRelatedToMe', 'relatedBallot') | |
->where($subQuery->expr()->eq('floorModifiedProposal.id', ':floorModifiedProposalId')); | |
$qb->andWhere($qb->expr()->notIn('fmps.id', $subQuery->getDQL())) | |
->setParameter('floorModifiedProposalId', $floorModifiedProposalId); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment