StaticReferenceRepository::getAll()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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