bonjour,
je cherche a faire une requet createQueryBuilder qui me retournais tous les hotels qui n'ont pas de chambre a 0 mais aussi l'hotel a 0 qui aurait été assigné a un participant.
Voici le code:
et bien ce code ne marche pas.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 //ex: Participants = 4 $res = 4; $query = $er->createQueryBuilder('u'); $res = $participants->getHotel() ? $participants->getHotel()->getId() : null; if( $res == null){ $query->where( $query->expr()->orx( $query->expr()->andX('u.bedroom > 0'), $query->expr()->andX( $query>expr()->eq('a.id', ':Participants')) ) ); $query ->setParameter('Participants',$res); }
Merci de votre aide.
Partager