Completed
Push — master ( 1f2c43...a9e289 )
by Valentyn
04:43 queued 17s
created

GenreRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 16
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A findByTmdbIds() 0 8 1
1
<?php
2
declare(strict_types=1);
3
4
namespace App\Genres\Repository;
5
6
use App\Genres\Entity\Genre;
7
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
8
use Symfony\Bridge\Doctrine\RegistryInterface;
9
10
/**
11
 * @method Genre|null find($id, $lockMode = null, $lockVersion = null)
12
 * @method Genre|null findOneBy(array $criteria, array $orderBy = null)
13
 * @method Genre[]    findAll()
14
 * @method Genre[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
15
 */
16
class GenreRepository extends ServiceEntityRepository
17
{
18 10
    public function __construct(RegistryInterface $registry)
19
    {
20 10
        parent::__construct($registry, Genre::class);
21 10
    }
22
23 1
    public function findByTmdbIds(array $ids)
24
    {
25 1
        return $this->createQueryBuilder('g')
26 1
            ->where('g.tmdb_id IN (:ids)')
27 1
            ->setParameter('ids', $ids)
28 1
            ->getQuery()
29 1
            ->getResult();
30
    }
31
}
32