| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 23 | public function loadIndividualCodes(string $promotionId): array |
||
| 24 | { |
||
| 25 | $qb = $this->connection->createQueryBuilder(); |
||
| 26 | |||
| 27 | $qb->select('code'); |
||
| 28 | $qb->from('promotion_individual_code'); |
||
| 29 | $qb->where($qb->expr()->eq('promotion_id', ':id')); |
||
| 30 | $qb->setParameter(':id', Uuid::fromHexToBytes($promotionId)); |
||
| 31 | |||
| 32 | /** @var array|bool $result */ |
||
| 33 | $result = $qb->execute()->fetchAll(\PDO::FETCH_COLUMN); |
||
| 34 | |||
| 35 | if ($result !== (array) $result) { |
||
| 36 | return []; |
||
| 37 | } |
||
| 38 | |||
| 39 | return $result; |
||
| 40 | } |
||
| 48 |