Failed Conditions
Push — experimental/3.1 ( 94d0cd...3ded70 )
by chihiro
23s
created

AbstractRepository::getCacheLifetime()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
4
namespace Eccube\Repository;
5
6
7
use Doctrine\ORM\EntityRepository;
8
use Eccube\Annotation\Inject;
9
use Eccube\Entity\AbstractEntity;
10
11
class AbstractRepository extends EntityRepository
0 ignored issues
show
introduced by
Missing class doc comment
Loading history...
12
{
13
    /**
14
     * @Inject("config")
15
     * @var array
16
     */
17
    protected $appConfig;
18
19
    /**
20
     * エンティティを削除します。
21
     * 物理削除ではなく、del_flgを利用した論理削除を行います。
22
     *
23
     * @param AbstractEntity $entity
24
     */
25 2
    public function delete($entity)
26
    {
27 2
        $this->getEntityManager()->remove($entity);
28
    }
29
30
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$entity" missing
Loading history...
31
     * エンティティの登録/保存します。
32
     *
33
     * @param $entity|AbstractEntity エンティティ
0 ignored issues
show
introduced by
Missing parameter name
Loading history...
34
     */
35
    public function save($entity)
36
    {
37
        $this->getEntityManager()->persist($entity);
38
    }
39
40 1094
    protected function getCacheLifetime()
41
    {
42 1094
        $options = $this->appConfig['doctrine_cache'];
43 1094
        return $options['result_cache']['lifetime'];
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
44
    }
45
}
46