Completed
Push — dev ( 506a4f...5de78b )
by Arnaud
02:52 queued 02:46
created

DoctrineRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 2
c 1
b 1
f 0
lcom 1
cbo 2
dl 0
loc 23
ccs 0
cts 10
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A save() 0 5 1
A delete() 0 5 1
1
<?php
2
3
namespace LAG\AdminBundle\Repository;
4
5
use Doctrine\ORM\EntityRepository;
6
7
/**
8
 * Abstract doctrine repository
9
 */
10
abstract class DoctrineRepository extends EntityRepository implements RepositoryInterface
11
{
12
    /**
13
     * Save an entity.
14
     *
15
     * @param $entity
16
     */
17
    public function save($entity)
18
    {
19
        $this->_em->persist($entity);
20
        $this->_em->flush($entity);
21
    }
22
    /**
23
     * Delete an entity.
24
     *
25
     * @param $entity
26
     */
27
    public function delete($entity)
28
    {
29
        $this->_em->remove($entity);
30
        $this->_em->flush($entity);
31
    }
32
}
33