getEntityManager()->createQueryBuilder(); $qb->delete($entityClass, 'x'); $qb->getQuery()->execute(); } $this->getEntityManager()->clear(); } }