|
@@ -20,7 +20,8 @@ class FilmRepository extends ServiceEntityRepository
|
|
|
parent::__construct($registry, Film::class);
|
|
|
}
|
|
|
|
|
|
- public function findFilm($id) {
|
|
|
+ public function findFilm($id): Film
|
|
|
+ {
|
|
|
$qb = $this->createQueryBuilder('f');
|
|
|
$query = $qb
|
|
|
->select('f.titre', 'f.annee')
|
|
@@ -30,7 +31,8 @@ class FilmRepository extends ServiceEntityRepository
|
|
|
return $query->getSingleResult();
|
|
|
}
|
|
|
|
|
|
- public function findFilmWithGenre(array $genreNames) {
|
|
|
+ public function findFilmWithGenre(array $genreNames) : array
|
|
|
+ {
|
|
|
$qb = $this->createQueryBuilder('f');
|
|
|
$qb
|
|
|
->innerJoin('f.genres', 'g')
|
|
@@ -43,7 +45,8 @@ class FilmRepository extends ServiceEntityRepository
|
|
|
->getResult();
|
|
|
}
|
|
|
|
|
|
- public function findFilmWithReal(array $realisateursnames) {
|
|
|
+ public function findFilmWithReal(array $realisateursnames): array
|
|
|
+ {
|
|
|
$qb = $this->createQueryBuilder('f');
|
|
|
$qb
|
|
|
->leftJoin('f.realisateurs', 'rea')
|
|
@@ -55,7 +58,7 @@ class FilmRepository extends ServiceEntityRepository
|
|
|
->getResult();
|
|
|
}
|
|
|
|
|
|
- public function findFilmWithRealLike($query)
|
|
|
+ public function findFilmWithRealLike($query): array
|
|
|
{
|
|
|
$qb = $this->createQueryBuilder('f');
|
|
|
$qb
|
|
@@ -69,7 +72,8 @@ class FilmRepository extends ServiceEntityRepository
|
|
|
|
|
|
}
|
|
|
|
|
|
- public function findFilmWithGenreLike($genreName) {
|
|
|
+ public function findFilmWithGenreLike($genreName): array
|
|
|
+ {
|
|
|
$qb = $this->createQueryBuilder('f');
|
|
|
$qb
|
|
|
->innerJoin('f.genres', 'g')
|
|
@@ -85,7 +89,8 @@ class FilmRepository extends ServiceEntityRepository
|
|
|
|
|
|
|
|
|
|
|
|
- public function findTousDesc() {
|
|
|
+ public function findTousDesc(): array
|
|
|
+ {
|
|
|
$qb = $this->createQueryBuilder('f');
|
|
|
$qb
|
|
|
->select('f')
|
|
@@ -96,7 +101,8 @@ class FilmRepository extends ServiceEntityRepository
|
|
|
->getResult();
|
|
|
}
|
|
|
|
|
|
- public function findTous () {
|
|
|
+ public function findTous (): array
|
|
|
+ {
|
|
|
$qb = $this->createQueryBuilder('f')
|
|
|
->leftJoin('f.authered', 'aut')->addSelect('aut')
|
|
|
->leftJoin('f.genres', 'gen')->addSelect('gen')
|
|
@@ -107,7 +113,7 @@ class FilmRepository extends ServiceEntityRepository
|
|
|
->getResult();
|
|
|
}
|
|
|
|
|
|
- public function findTousFavoritesByUser($user)
|
|
|
+ public function findTousFavoritesByUser($user): array
|
|
|
{
|
|
|
$qb = $this->createQueryBuilder('f');
|
|
|
$qb
|
|
@@ -123,7 +129,7 @@ class FilmRepository extends ServiceEntityRepository
|
|
|
->getResult();
|
|
|
}
|
|
|
|
|
|
- public function findProchaines()
|
|
|
+ public function findProchaines(): array
|
|
|
{
|
|
|
$date = new \DateTime('now');
|
|
|
$interval = new \DateInterval("P1D");
|
|
@@ -141,4 +147,15 @@ class FilmRepository extends ServiceEntityRepository
|
|
|
->getQuery()
|
|
|
->getResult();
|
|
|
}
|
|
|
+
|
|
|
+ public function findFilmWithExistentTitre(string $titre): array
|
|
|
+ {
|
|
|
+ return $this->createQueryBuilder('f')
|
|
|
+ ->leftJoin('f.realisateurs', 'r')->addSelect('r')
|
|
|
+ ->where('f.titre = :titre')
|
|
|
+ ->setParameter('titre', $titre)
|
|
|
+ ->getQuery()
|
|
|
+ ->getResult()
|
|
|
+ ;
|
|
|
+ }
|
|
|
}
|