Completed
Pull Request — master (#311)
by Łukasz
05:40
created

ResourceElement::getResourceValueRepository()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * (c) FSi sp. z o.o. <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace FSi\Bundle\AdminBundle\Doctrine\Admin;
13
14
use FSi\Bundle\AdminBundle\Admin\ResourceRepository\GenericResourceElement;
15
use FSi\Bundle\ResourceRepositoryBundle\Model\ResourceValue;
16
use FSi\Bundle\ResourceRepositoryBundle\Model\ResourceValueRepository;
17
18
abstract class ResourceElement extends GenericResourceElement implements Element
19
{
20
    use ElementImpl;
21
22
    public function getResourceValueRepository(): ResourceValueRepository
23
    {
24
        return $this->getRepository();
25
    }
26
27
    public function save(ResourceValue $resource): void
28
    {
29
        $this->getObjectManager()->persist($resource);
30
        $this->getObjectManager()->flush();
31
    }
32
}
33