ApiCacheRepository   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A findOneByKey() 0 9 1
1
<?php
2
3
namespace Dekalee\AdbackAnalyticsBundle\Repository;
4
5
use Dekalee\AdbackAnalyticsBundle\Entity\ApiCache;
6
7
/**
8
 * Class ApiCacheRepository
9
 */
10
class ApiCacheRepository extends \Doctrine\ORM\EntityRepository
11
{
12
    /**
13
     * @param string $key
14
     *
15
     * @return null|ApiCache
16
     */
17
    public function findOneByKey($key)
18
    {
19
        $qb = $this->createQueryBuilder('a');
20
21
        $qb->andWhere($qb->expr()->eq('a.key', ':key'));
22
        $qb->setParameter('key', $key);
23
24
        return $qb->getQuery()->getOneOrNullResult();
25
    }
26
}
27