Test Failed
Push — zf3-version ( b5b4e1...3457ba )
by Diego
04:58
created

SectorRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 19
rs 10
c 1
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
    public function getSector($sector)
10
    {
11
        $dql = 'SELECT s FROM Api\Entity\Sector s WHERE s.id = :sector';
12
13
        return $this->getEntityManager()->createQuery($dql)
14
            ->setParameter('sector', $sector)
15
            ->getArrayResult();
16
    }
17
18
    public function getSectorsOrderedyName()
19
    {
20
        $dql = 'SELECT s.name, s.color FROM Api\Entity\Sector s ORDER BY s.name';
21
22
        return $this->getEntityManager()->createQuery($dql)
23
            ->getArrayResult();
24
    }
25
}
26