Created
July 24, 2013 07:14
-
-
Save serapheem/6068609 to your computer and use it in GitHub Desktop.
Doctrine 2 - Using identifier of relation in DQL query
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
<?php | |
$qb = $this->get('doctrine.orm.entity_manager')->createQueryBuilder(); | |
$qb->select('v.id') | |
->from('CormesClipkitApiBundle:Video', 'v') | |
->where('IDENTITY(v.user) in (?1)') | |
->setParameter(1, $coIds) | |
->setFirstResult(rand(0, $count - $resnum)) | |
->setMaxResults($resnum); | |
$result = $qb->getQuery()->getResult(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment