Completed
Push — master ( 59ed7d...9fb967 )
by Valentyn
02:51
created

ActorRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 14
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

2 Methods

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