Completed
Pull Request — master (#137)
by
unknown
11:35
created

CustomerRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 21
rs 10
c 1
b 0
f 0
wmc 2
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A findUsernameByApiKey() 0 8 1
A findUserByFacebook() 0 9 1
1
<?php
2
3
namespace AppBundle\Repository;
4
5
/**
6
 * CustomerRepository
7
 *
8
 * This class was generated by the Doctrine ORM. Add your own custom
9
 * repository methods below.
10
 */
11
class CustomerRepository extends \Doctrine\ORM\EntityRepository
12
{
13
    public function findUsernameByApiKey($param){
14
        return $this->createQueryBuilder('c')
15
            ->select('c.username, c.id')
16
            ->where('c.apiKey =: param')
17
            ->setParameter(':param', $param)
18
            ->getQuery()
19
            ->getResult();
20
    }
21
22
    public function findUserByFacebook($param)
23
    {
24
        return $this->createQueryBuilder('customer')
25
            ->select('customer.id, customer.username, customer.facebookID')
26
            ->where('customer.facebookID= :param')
27
            ->setParameter(':param', $param)
28
            ->getQuery()
29
            ->getResult();
30
    }
31
}
32