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

ReleaseDateQueueRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 19
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A findAllWithMovies() 0 11 1
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