When using the following only the last where
is added to my query;
$qb = $this->getEntityManager()->createQueryBuilder();
$qb->select(array('qi'))
->from('Table:Qi', 'qi')
->where("qi.content = " . $content->getId())
->where("qi.queue = " . $child->getQueue()->getId());
I had to do this to make it take notice of both
$qb->select(array('qi'))
->from('Table:Qi', 'qi')
->where("qi.content = " . $content->getId() .
" AND qi.queue = " . $child->getQueue()->getId());
This does not seem right? How can I use the first approach with multiple where
calls?
You can use ->andWhere
like this:
->where("qi.content = " . $content->getId())
->andWhere("qi.queue = " . $child->getQueue()->getId());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With