|
@@ -122,4 +122,23 @@ class FilmRepository extends ServiceEntityRepository
|
|
|
->getQuery()
|
|
|
->getResult();
|
|
|
}
|
|
|
+
|
|
|
+ public function findProchaines()
|
|
|
+ {
|
|
|
+ $date = new \DateTime('now');
|
|
|
+ $interval = new \DateInterval("P1D");
|
|
|
+ $interval->invert = 1;
|
|
|
+ $date->add($interval);
|
|
|
+ $qb = $this->createQueryBuilder('f');
|
|
|
+ $qb
|
|
|
+ ->leftJoin('f.authered', 'aut')->addSelect('aut')
|
|
|
+ ->leftJoin('f.genres', 'gen')->addSelect('gen')
|
|
|
+ ->leftJoin('f.realisateurs', 'rea')->addSelect('rea')
|
|
|
+ ->where('f.dateSortie > :date')
|
|
|
+ ->setParameter('date', $date)
|
|
|
+ ->orderBy('f.dateSortie', 'ASC');
|
|
|
+ return $qb
|
|
|
+ ->getQuery()
|
|
|
+ ->getResult();
|
|
|
+ }
|
|
|
}
|