| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 42 | public function findByUsername(string $username, int $pid) |
||
| 43 | { |
||
| 44 | $qb = $this->pool->getConnectionForTable($this->table)->createQueryBuilder(); |
||
| 45 | $qb->select('*')->from($this->table); |
||
| 46 | $qb->where($qb->expr()->andX( |
||
| 47 | $qb->expr()->eq('username', ':username'), |
||
| 48 | $qb->expr()->eq('pid', ':pid') |
||
| 49 | )); |
||
| 50 | $qb->setParameter('username', $username); |
||
| 51 | $qb->setParameter('pid', $pid); |
||
| 52 | |||
| 53 | $data = $qb->execute()->fetch(\PDO::FETCH_ASSOC); |
||
| 54 | |||
| 55 | if (\is_array($data)) { |
||
| 56 | return new FrontendUser($data); |
||
| 57 | } |
||
| 58 | |||
| 59 | return null; |
||
| 60 | } |
||
| 62 |