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

findActivitySectorBySector()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
3
namespace Api\Entity;
4
5
use Doctrine\ORM\EntityRepository;
6
7
class SubactivityRepository extends EntityRepository
8
{
9
	public function findActivitySectorBySector($sector)
10
	{
11
		$dql = 'SELECT sub.name
12
            FROM Api\Entity\Subactivity sub
13
            INNER JOIN sub.activity a 
14
            INNER JOIN Api\Entity\Sector s WITH s.id = a.sector
15
            WHERE s.id = :sector
16
            ORDER BY sub.name';
17
18
        return $this->getEntityManager()->createQuery($dql)
19
            ->setParameter('sector', $sector)
20
            ->getResult();       	
21
	}
22
}
23