Completed
Pull Request — release-v2.1 (#14)
by Quentin
09:51 queued 06:38
created

ApplicationRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 2
c 2
b 0
f 2
lcom 0
cbo 1
dl 0
loc 24
ccs 0
cts 12
cp 0
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\Model\ApplicationInterface;
6
use Majora\Component\OAuth\Repository\ApplicationRepositoryInterface;
7
use Majora\Framework\Repository\Doctrine\BaseDoctrineRepository;
8
9
/**
10
 * Application repository implementation.
11
 */
12
class ApplicationRepository extends BaseDoctrineRepository implements ApplicationRepositoryInterface
13
{
14
    /**
15
     * @see TokenRepositoryInterface::persist()
16
     */
17
    public function persist(ApplicationInterface $application)
18
    {
19
        $em = $this->getEntityManager();
20
21
        $em->persist($application);
22
        $em->flush();
23
    }
24
25
    /**
26
     * @see TokenRepositoryInterface::remove()
27
     */
28
    public function remove(ApplicationInterface $application)
29
    {
30
        $em = $this->getEntityManager();
31
32
        $em->remove($application);
33
        $em->flush();
34
    }
35
}
36