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

DoctrineRepository::save()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
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