SectorRepository::getSector()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
crap 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