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

GenreMapRepository::delete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
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