Completed
Pull Request — master (#244)
by Łukasz
09:35
created

CRUDElement::delete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
/**
4
 * (c) FSi sp. z o.o. <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace FSi\Bundle\AdminBundle\Doctrine\Admin;
11
12
use FSi\Bundle\AdminBundle\Admin\CRUD\AbstractCRUD;
13
14
/**
15
 * @author Norbert Orzechowicz <[email protected]>
16
 */
17
abstract class CRUDElement extends AbstractCRUD implements Element
18
{
19
    use DataIndexerElementImpl;
20
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function save($object)
25
    {
26
        $this->getObjectManager()->persist($object);
27
        $this->getObjectManager()->flush();
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function saveDataGrid()
34
    {
35
        $this->getObjectManager()->flush();
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function delete($object)
42
    {
43
        $this->getObjectManager()->remove($object);
44
        $this->getObjectManager()->flush();
45
    }
46
}
47