RadioStationRepository::delete()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Uxmp\Core\Orm\Repository;
6
7
use Doctrine\ORM\EntityRepository;
8
use Uxmp\Core\Orm\Model\RadioStation;
9
use Uxmp\Core\Orm\Model\RadioStationInterface;
10
11
/**
12
 * @extends EntityRepository<RadioStation>
13
 *
14
 * @method null|RadioStationInterface find(mixed $id)
15
 */
16
final class RadioStationRepository extends EntityRepository implements RadioStationRepositoryInterface
17
{
18
    /**
19
     * Create a new RadioStation instance
20
     */
21 1
    public function prototype(): RadioStationInterface
22
    {
23 1
        return new RadioStation();
24
    }
25
26
    /**
27
     * Saves the RadioStation
28
     */
29 1
    public function save(RadioStationInterface $station): void
30
    {
31 1
        $this->getEntityManager()->persist($station);
32 1
        $this->getEntityManager()->flush();
33
    }
34
35
    /**
36
     * Deletes the RadioStation
37
     */
38 1
    public function delete(RadioStationInterface $station): void
39
    {
40 1
        $this->getEntityManager()->remove($station);
41 1
        $this->getEntityManager()->flush();
42
    }
43
}
44