I was used discriminator column in where clause like this:
//f = root entity
$qb = $this->createQueryBuilder(\'f\');
$qb->add(\'where\', \'f.format = \
As this latest doctrine version it is supported to query directly the discriminator value.
public function findOfType($discr)
{
$qb = $this->createQueryBuilder('e');
$qb->where('e INSTANCE OF :discr');
$qb->setParameter('discr', $discr);
return $qb->getQuery()->getResult();
}
will have a result query with this clause:
WHERE e0_.discr IN ('discriminator_passed_to_function')