1
我有實體(組)的陣列中的一個實體(用戶),並在我的查詢生成器,我想這樣做:主義查詢生成器:在SQL ARRAY值
$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);
}
但是主義不喜歡它。 是否有另一種方法來檢查值是否在SQL數組中?
謝謝。
它的工作非常感謝! – Julien