Explorar o código

Suppression $notes

François Drouhard %!s(int64=5) %!d(string=hai) anos
pai
achega
54f83f3243

+ 2 - 4
src/Controller/VideothequeController.php

@@ -23,14 +23,12 @@ class VideothequeController extends AbstractController
 	 */
 	public function listeAction(Request $request, EntityManagerInterface $em)
 	{
-        $note = (int) $request->query->get('note');
-		$repo = $em->getRepository('App:Film');
-        $listeFilms = $repo->findTous($note);
+		$repo = $em->getRepository(Film::class);
+        $listeFilms = $repo->findTous();
 
 		return $this->render('videotheque/liste.html.twig', array(
             'listeFilms'	=>	$listeFilms,
             'titre'         =>  'Liste complète',
-            'note'          =>  $note
 		));
     }
 

+ 1 - 7
src/Repository/FilmRepository.php

@@ -86,18 +86,12 @@ class FilmRepository extends \Doctrine\ORM\EntityRepository
             ->getResult();
     }
 
-    public function findTous ($note = 0) {
+    public function findTous () {
         $qb = $this->createQueryBuilder('f')
             ->leftJoin('f.authered', 'aut')->addSelect('aut')
             ->leftJoin('f.genres', 'gen')->addSelect('gen')
             ->leftJoin('f.realisateurs', 'rea')->addSelect('rea')
             ->orderBy('f.dateSubmited', 'DESC');
-
-        if ($note > 0) {
-            $qb
-                ->andWhere('f.note >= :note')
-                ->setParameter('note', $note);
-        }
         return $qb
             ->getQuery()
             ->getResult();

+ 0 - 2
templates/videotheque/liste.html.twig

@@ -19,7 +19,6 @@
 			<div class="col-6">
 				{# Des filtres ? #}
 			</div>
-			{% if note is defined %}
 			<div class="col-3 text-right">
 				<p>Filtrer par film au dessus de
 				<input class="rating"
@@ -36,7 +35,6 @@
 					value="0">
 				</p>
 			</div>
-			{% endif %}
 		</div>
 	</div>
 	<div class="table-responsive">