public function delete($id) { $em = $this->getEntityManager(); $proxy = $em->getReference('Newscoop\\Entity\\User\\Group', (int) $id); $em->remove($proxy); $em->flush(); }