public function delete($id) { $this->em->remove($this->repository->find((int) $id)); $this->em->flush(); }