Passed
Push — dependabot/npm_and_yarn/nanoid... ( aaf2c9...c4aa90 )
by
unknown
14:37 queued 06:22
created

ValidationTokenRepository::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/* For licensing terms, see /license.txt */
6
7
namespace Chamilo\CoreBundle\Repository;
8
9
use Chamilo\CoreBundle\Entity\ValidationToken;
10
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
11
use Doctrine\Persistence\ManagerRegistry;
12
13
class ValidationTokenRepository extends ServiceEntityRepository
14
{
15
    public function __construct(ManagerRegistry $registry)
16
    {
17
        parent::__construct($registry, ValidationToken::class);
18
    }
19
20
    public function save(ValidationToken $entity, bool $flush = false): void
21
    {
22
        $this->getEntityManager()->persist($entity);
23
24
        if ($flush) {
25
            $this->getEntityManager()->flush();
26
        }
27
    }
28
29
    public function remove(ValidationToken $entity, bool $flush = false): void
30
    {
31
        $this->getEntityManager()->remove($entity);
32
33
        if ($flush) {
34
            $this->getEntityManager()->flush();
35
        }
36
    }
37
}
38