| 
					
				 | 
			
			
				@@ -2,24 +2,23 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 namespace App\Service; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-use App\Entity\Commentaire; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-use Doctrine\ORM\EntityManagerInterface; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+use App\Repository\CommentaireRepository; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 use Twig\Environment; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 use Twig\Extension\RuntimeExtensionInterface; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 class Nouveautes implements RuntimeExtensionInterface 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private $twig; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private $em; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private $repoCommentaire; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function __construct(EntityManagerInterface $em, Environment $twig) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function __construct(CommentaireRepository $repoCommentaire, Environment $twig) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $this->em = $em; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $this->repoCommentaire = $repoCommentaire; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $this->twig = $twig; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public function afficher () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $commentaires = $this->em->getRepository(Commentaire::class)->findLast(5); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $commentaires = $this->repoCommentaire->findLast(5); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return $this->twig->render('nouveautes/nouveautes.html.twig', [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             'commentaires'  =>  $commentaires 
			 |