Completed
Push — master ( c5110b...a167e6 )
by Valentyn
13:46
created

ReleaseDateQueueRepository::findAllWithMovies()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 0
cts 8
cp 0
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Movies\Repository;
6
7
use App\Movies\Entity\ReleaseDateQueue;
8
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
9
use Doctrine\ORM\Query;
10
use Symfony\Bridge\Doctrine\RegistryInterface;
11
12
/**
13
 * @method ReleaseDateQueue|null find($id, $lockMode = null, $lockVersion = null)
14
 * @method ReleaseDateQueue|null findOneBy(array $criteria, array $orderBy = null)
15
 * @method ReleaseDateQueue[]    findAll()
16
 * @method ReleaseDateQueue[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
17
 */
18
class ReleaseDateQueueRepository extends ServiceEntityRepository
19
{
20
    public function __construct(RegistryInterface $registry)
21
    {
22
        parent::__construct($registry, ReleaseDateQueue::class);
23
    }
24
25
    public function findAllWithMovies(int $isActive = 1): Query
26
    {
27
        $query = $this->createQueryBuilder('rdq')
28
            ->leftJoin('rdq.movie', 'm')
29
            ->addSelect('m')
30
            ->where('rdq.isActive = :active')
31
            ->setParameter('active', $isActive)
32
            ->getQuery();
33
34
        return $query;
35
    }
36
}
37