_em->persist($entity); $this->_em->flush($entity); } public function delete($entity) { $this->_em->remove($entity); $this->_em->flush($entity); } }