I have an array of entities (groups) in an entity (user), and in my Query Builder I would like to do something like this:
$groups = $current_user->getGroups(); $usersQuery = $em->getRepository('AppBundle:Users')->createQueryBuilder('u'); foreach ($groups as $group) { $usersQuery ->orWhere(':group_value in (u.groups)') ->setParameter('group_value', $group); } But doctrine doesn't like it. Is there another way to check if a value is in a SQL array ?
Thanks.