Passed
Push — main ( d7832a...2d8ac8 )
by Daniel
04:45
created

GenreMapRepository   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 18
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A delete() 0 4 1
A save() 0 4 1
A prototype() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Uxmp\Core\Orm\Repository;
6
7
use Doctrine\ORM\EntityRepository;
8
use JetBrains\PhpStorm\Pure;
9
use Uxmp\Core\Orm\Model\GenreMap;
10
use Uxmp\Core\Orm\Model\GenreMapInterface;
11
12
/**
13
 * @extends EntityRepository<GenreMapInterface>
14
 *
15
 * @method null|GenreMapInterface findOneBy(mixed[] $criteria)
16
 */
17
final class GenreMapRepository extends EntityRepository implements GenreMapRepositoryInterface
18
{
19
    #[Pure]
20
    public function prototype(): GenreMapInterface
21
    {
22
        return new GenreMap();
23
    }
24
25
    public function save(GenreMapInterface $genreMap): void
26
    {
27
        $this->getEntityManager()->persist($genreMap);
28
        $this->getEntityManager()->flush();
29
    }
30
31
    public function delete(GenreMapInterface $genreMap): void
32
    {
33
        $this->getEntityManager()->remove($genreMap);
34
        $this->getEntityManager()->flush();
35
    }
36
}
37