| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function getByExternalReference(string $externalReference): Product |
||
| 30 | { |
||
| 31 | $product = $this->entityRepository->findOneBy(['externalReference' => $externalReference]); |
||
| 32 | |||
| 33 | if (!$product instanceof Product) { |
||
| 34 | throw new NoEntityFoundException(sprintf("Unable to find product for external reference '%s'", $externalReference)); |
||
| 35 | } |
||
| 36 | |||
| 37 | return $product; |
||
| 38 | } |
||
| 40 |