Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Bonjour,
Bon je cherche, je cherche mais j'aboutis à rien.
Voici ma requête :
[lang=php]
$qb = $this->createQueryBuilder('n');
$qb->addSelect($qb->expr()->quot('n.champ1', 'n.champ2').' AS ratio')
->where('n.status = 1');
return $qb->getQuery()->getResult();J'obtiens un résultat comme ci-dessous :
array
0 =>
array
0 =>
object(Application\Entity\News)[514]Mais si je commente la ligne $qb->addSelect($qb->expr()->quot('n.champ1', 'n.champ2').' AS ratio') j'obtiens un seul array:
array
0 =>
object(Application\Entity\News)[514]Voilà c'est bizarre je ne comprends pas pourquoi il me rajoute un array en plus lorsque j'ajoute un $qb->expr()
J'aimerais donc obtenir le 2e résultat, donc une petite idée ?
Merci d'avance
Hors ligne