bySku() public static method

public static bySku ( SKU $sku ) : ProductNotFoundException
$sku Dumplie\SharedKernel\Domain\Product\SKU
return ProductNotFoundException
Beispiel #1
0
 /**
  * @param SKU $sku
  *
  * @return Product
  *
  * @throws ProductNotFoundException
  */
 public function getBySku(SKU $sku) : Product
 {
     if (!array_key_exists((string) $sku, $this->products)) {
         throw ProductNotFoundException::bySku($sku);
     }
     return $this->products[(string) $sku];
 }