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

ApplicationRepository::persist()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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