| @@ 20-29 (lines=10) @@ | ||
| 17 | class UserRepository extends EntityRepository implements UserRepositoryInterface |
|
| 18 | { |
|
| 19 | /** @return UserEntity */ |
|
| 20 | public function findByEmail(string $email) |
|
| 21 | { |
|
| 22 | $result = $this->createQueryBuilder('u') |
|
| 23 | ->where('u.email = :email') |
|
| 24 | ->setParameter('email', $email) |
|
| 25 | ->getQuery() |
|
| 26 | ->getResult(); |
|
| 27 | ||
| 28 | return $result && $result[0] ? $result[0] : null; |
|
| 29 | } |
|
| 30 | ||
| 31 | /** @return UserEntity */ |
|
| 32 | public function findById(int $id) |
|
| @@ 32-41 (lines=10) @@ | ||
| 29 | } |
|
| 30 | ||
| 31 | /** @return UserEntity */ |
|
| 32 | public function findById(int $id) |
|
| 33 | { |
|
| 34 | $result = $this->createQueryBuilder('u') |
|
| 35 | ->where('u.id = :id') |
|
| 36 | ->setParameter('id', $id) |
|
| 37 | ->getQuery() |
|
| 38 | ->getResult(); |
|
| 39 | ||
| 40 | return $result && $result[0] ? $result[0] : null; |
|
| 41 | } |
|
| 42 | } |
|
| 43 | ||