I\'m using the FormType for an Entity of mine, and setting up an entity field. I need two Where clauses in an And, an
Where
And
You can use isNotNull:
'query_builder' => function ($er){ $qb = $er->createQueryBuilder('p'); $qb ->where($qb->expr()->andx( $qb->expr()->in('p', '?1'), $qb->expr()->isNotNull('p.location') )) ->setParameter(1, $this->totalScope); return $qb; },