SectorRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 19
ccs 9
cts 9
cp 1
rs 10
c 2
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSector() 0 8 1
A getSectorsOrderedyName() 0 7 1
1
<?php
2
3
namespace Api\Entity;
4
5
use Doctrine\ORM\EntityRepository;
6
7
class SectorRepository extends EntityRepository
8
{
9 2
    public function getSector($sector)
10
    {
11 2
        $dql = 'SELECT s FROM Api\Entity\Sector s WHERE s.id = :sector';
12
13 2
        return $this->getEntityManager()->createQuery($dql)
14 2
            ->setParameter('sector', $sector)
15 2
            ->getArrayResult();
16
    }
17
18 2
    public function getSectorsOrderedyName()
19
    {
20 2
        $dql = 'SELECT s.name, s.color FROM Api\Entity\Sector s ORDER BY s.name';
21
22 2
        return $this->getEntityManager()->createQuery($dql)
23 2
            ->getArrayResult();
24
    }
25
}
26