Completed
Push — nyx-refresh-token-orm-config ( 30c2e2...f6baea )
by Quentin
05:18
created

AccountRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
c 2
b 0
f 1
lcom 0
cbo 1
dl 0
loc 24
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A persist() 0 7 1
A remove() 0 7 1
1
<?php
2
3
namespace Majora\Component\OAuth\Repository\ORM;
4
5
use Majora\Component\OAuth\Repository\AccountRepositoryInterface;
6
use Majora\Framework\Repository\Doctrine\BaseDoctrineRepository;
7
8
/**
9
 * Account repository implementation.
10
 */
11
class AccountRepository extends BaseDoctrineRepository implements AccountRepositoryInterface
12
{
13
    /**
14
     * @see AccountRepositoryInterface::persist()
15
     */
16
    public function persist(AccountInterface $account)
17
    {
18
        $em = $this->getEntityManager();
19
20
        $em->persist($account);
21
        $em->flush();
22
    }
23
24
    /**
25
     * @see AccountRepositoryInterface::remove()
26
     */
27
    public function remove(AccountInterface $account)
28
    {
29
        $em = $this->getEntityManager();
30
31
        $em->remove($account);
32
        $em->flush();
33
    }
34
}
35