Ответ для нескольких экземпляров фактически не работает.Вы должны сделать что-то подобное, чтобы проверить наличие нескольких экземпляров.
$classes = ['Entity\Manager', 'Entity\Customer'];
$qb = $this->createQueryBuilder('u');
->where('u.id > 10') //an arbitrary condition, to show it can be combined with multiple instances tests
->andWhere("u INSTANCE OF ('" . implode("','", $classes) . "')");