public function deleteAndFlush($entity, $entityManager = null)
    {
        $entityManager = $this->getEntityManager($entityManager);

        $entityManager->remove($entity);
        $entityManager->flush($entity);
    }