| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function getByExternalReference(string $externalReference): Price |
||
| 36 | { |
||
| 37 | $price = $this->entityRepository->findOneBy(['externalReference' => $externalReference]); |
||
| 38 | |||
| 39 | if (!$price instanceof Price) { |
||
| 40 | throw new NoEntityFoundException(sprintf("Unable to find price for external reference '%s'", $externalReference)); |
||
| 41 | } |
||
| 42 | |||
| 43 | return $price; |
||
| 44 | } |
||
| 46 |