AccountRepository::persist()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
ccs 0
cts 6
cp 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Majora\Component\OAuth\Repository\ORM;
4
5
use Majora\Component\OAuth\Model\AccountInterface;
6
use Majora\Component\OAuth\Repository\AccountRepositoryInterface;
7
use Majora\Framework\Repository\Doctrine\BaseDoctrineRepository;
8
9
/**
10
 * Account repository implementation.
11
 */
12
class AccountRepository extends BaseDoctrineRepository implements AccountRepositoryInterface
13
{
14
    /**
15
     * @see AccountRepositoryInterface::persist()
16
     */
17
    public function persist(AccountInterface $account)
18
    {
19
        $em = $this->getEntityManager();
20
21
        $em->persist($account);
22
        $em->flush();
23
    }
24
25
    /**
26
     * @see AccountRepositoryInterface::remove()
27
     */
28
    public function remove(AccountInterface $account)
29
    {
30
        $em = $this->getEntityManager();
31
32
        $em->remove($account);
33
        $em->flush();
34
    }
35
}
36