FavoriteRepository::save()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0
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\Favorite;
9
use Uxmp\Core\Orm\Model\FavoriteInterface;
10
11
/**
12
 * @extends EntityRepository<Favorite>
13
 *
14
 * @method FavoriteInterface[] findBy(mixed[] $criteria, null|array $order = null, null|int $limit = null, null|int $offset = null)
15
 */
16
final class FavoriteRepository extends EntityRepository implements FavoriteRepositoryInterface
17
{
18 1
    public function prototype(): FavoriteInterface
19
    {
20 1
        return new Favorite();
21
    }
22
23 1
    public function save(FavoriteInterface $favorite): void
24
    {
25 1
        $em = $this->getEntityManager();
26
27 1
        $em->persist($favorite);
28 1
        $em->flush();
29
    }
30
31 1
    public function delete(FavoriteInterface $favorite): void
32
    {
33 1
        $em = $this->getEntityManager();
34
35 1
        $em->remove($favorite);
36 1
        $em->flush();
37
    }
38
}
39