Completed
Pull Request — dev (#54)
by nonanerz
02:53
created

SurveyAnswerRepository::findAnswersBySurvey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
ccs 0
cts 8
cp 0
cc 1
eloc 6
nc 1
nop 1
crap 2
1
<?php
2
3
namespace AppBundle\Repository;
4
5
use AppBundle\Entity\Survey\Survey;
6
7
/**
8
 * SurveyAnswerRepository.
9
 *
10
 * This class was generated by the Doctrine ORM. Add your own custom
11
 * repository methods below.
12
 */
13
class SurveyAnswerRepository extends \Doctrine\ORM\EntityRepository
14
{
15
    public function findAnswersBySurvey(Survey $survey)
16
    {
17
        $query = $this->createQueryBuilder('a')
18
            ->where('a.survey = :survey')
19
            ->setParameter('survey', $survey)
20
            ->getQuery();
21
22
        return $query->getResult();
23
    }
24
}
25