コード例 #1
0
ファイル: ProductManager.php プロジェクト: spryker/Product
 /**
  * @param string $sku
  *
  * @throws \Spryker\Zed\Product\Business\Exception\MissingProductException
  *
  * @return string
  */
 public function getAbstractSkuFromProductConcrete($sku)
 {
     $productConcrete = $this->productQueryContainer->queryProductConcreteBySku($sku)->findOne();
     if (!$productConcrete) {
         throw new MissingProductException(sprintf('Tried to retrieve a product concrete with sku %s, but it does not exist.', $sku));
     }
     return $productConcrete->getSpyProductAbstract()->getSku();
 }