I am trying to get records from a table where patentgroup_id is null. I tried this
$repository = $this->getDoctrine()->getRepository('MunichInnovationGroupPatentBundle:SvPatents');
$qb1 = $repository->createQueryBuilder('sv')
->select('sv')
->where('sv.patentgroup = :patentgroup')
->setParameter('patentgroup', null)
->getQuery();
$nogroup_patents = $qb1->getArrayResult();
var_dump($nogroup_patents);
There is one record in the table whose patentgroup_id is null but I am getting empty array.
Any ideas? What I am doing wrong
thanks
same way you would do it in SQL