Browse Source

Correction vieilles écritures

François Drouhard 5 years ago
parent
commit
05d3add693
1 changed files with 8 additions and 7 deletions
  1. 8 7
      src/Controller/VideothequeController.php

+ 8 - 7
src/Controller/VideothequeController.php

@@ -11,6 +11,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\Routing\Annotation\Route;
 use Symfony\Component\HttpFoundation\Request;
 use App\Entity\Film;
+use App\Form\CommentaireType;
 use App\Form\FilmType;
 use App\Service\CommentaireManager;
 use App\Service\FilmManager;
@@ -37,7 +38,7 @@ class VideothequeController extends AbstractController
      */
 	public function  listeParGenreAction(\App\Entity\Genre $genre, EntityManagerInterface $em)
     {
-        $films = $em->getRepository('App:Film')->findFilmWithGenre(array($genre->getName()));
+        $films = $em->getRepository(Film::class)->findFilmWithGenre(array($genre->getName()));
 
         return $this->render('videotheque/liste.html.twig', array(
             'listeFilms'    => $films,
@@ -50,7 +51,7 @@ class VideothequeController extends AbstractController
      */
     public function  listeParRealisateurAction(Realisateur $realisateur, EntityManagerInterface $em)
     {
-        $films = $em->getRepository('App:Film')->findFilmWithReal(array($realisateur->getNomComplet()));
+        $films = $em->getRepository(Film::class)->findFilmWithReal(array($realisateur->getNomComplet()));
 
         return $this->render('videotheque/liste.html.twig', array(
             'listeFilms'    => $films,
@@ -126,12 +127,12 @@ class VideothequeController extends AbstractController
     {
         if ($security->isGranted('IS_AUTHENTICATED_REMEMBERED'))
         {
-            $commentaireUser = $em->getRepository('App:Commentaire')->findOneBy(array('film'=>$film, 'user'=>$this->getUser()));
+            $commentaireUser = $em->getRepository(Commentaire::class)->findOneBy(array('film'=>$film, 'user'=>$this->getUser()));
             if (is_null($commentaireUser))
             {
                 $commentaireUser = new Commentaire();
             }
-            $form = $this->createForm('App\Form\CommentaireType', $commentaireUser);
+            $form = $this->createForm(CommentaireType::class, $commentaireUser);
             $form->handleRequest($request);
             if ($form->isSubmitted() && $form->isValid())
             {
@@ -140,7 +141,7 @@ class VideothequeController extends AbstractController
                 return $this->redirectToRoute('videotheque_voirfilm', array('id' => $film->getId()));
             }
         } else {
-            $form = $this->createForm('App\Form\CommentaireType', null);
+            $form = $this->createForm(CommentaireType::class, null);
         }
         
         return $this->render('videotheque/voirfilm.html.twig', array(
@@ -155,7 +156,7 @@ class VideothequeController extends AbstractController
     public function ajaxRealisateurs(Request $request, EntityManagerInterface $em)
     {
         $realisateurs = $em
-            ->getRepository('App:Realisateur')
+            ->getRepository(Realisateur::class)
             ->findNomsComplets();
         $liste = array();
         foreach ($realisateurs as $key=>$nom)
@@ -172,7 +173,7 @@ class VideothequeController extends AbstractController
     public function ajaxGenres(Request $request, EntityManagerInterface $em)
     {
         $genres = $em
-            ->getRepository('App:Genre')
+            ->getRepository(Genre::class)
             ->findGenres();
         $liste = array();
         foreach ($genres as $key=>$nom)