Symfony2 and Doctrine2: INDEX BY in QueryBuilder
E.g.: INDEX BY id of the User entity:
$qb = $em->createQueryBuilder();
$qb->select('u')
->from('SomeUserBundle:User', 'u', 'u.id')
->add('where', $qb->expr()->like('u.roles', ':role'))
->setParameter('role', $role);
Reference:
http://www.doctrine-project.org/jira/browse/DDC-2322
Written by Andréia Bohner
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Doctrine2
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#