Réponse
public function delete(Comment $comment, ObjectManager $manager){
$manager->remove($comment);
$manager->flush();
Colonne
Explication
Sans le ParamConverter et par injection de dépendance, je l'aurais écrit :
public function delete(CommentRepository $repo, ObjectManager $manager, $id){
$comment=$repo->getComment($id);
$manager->remove($comment);
$manager->flush();
Question
Ecrire fonction simple (ex: delete) de suppression d'un commentaire (Comment Entity) en utilisant le ParamConverter de Symfony 4
Thématique