StaticReferenceRepository   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 7
c 2
b 1
f 0
dl 0
loc 18
ccs 0
cts 7
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAll() 0 10 1
1
<?php
2
/**
3
 * @author Gerard van Helden <[email protected]>
4
 * @copyright Zicht Online <http://zicht.nl>
5
 */
6
namespace Zicht\Bundle\UrlBundle\Entity\Repository;
7
8
use Doctrine\ORM\EntityRepository;
9
10
/**
11
 * Repository for the static references
12
 */
13
class StaticReferenceRepository extends EntityRepository
14
{
15
    /**
16
     * Returns the references for the specified locale
17
     *
18
     * @param string $locale
19
     * @return mixed
20
     */
21
    public function getAll($locale)
22
    {
23
        $qb = $this->createQueryBuilder('r');
24
25
        $qb->addSelect('t');
26
        $qb->innerJoin('r.translations', 't');
27
        $qb->andWhere('t.locale=:locale');
28
        $qb->setParameter(':locale', $locale);
29
30
        return $qb->getQuery()->execute();
31
    }
32
}
33