/** * @param \Generated\Shared\Transfer\PriceProductTransfer $transferPriceProduct * * @return bool */ protected function isPriceTypeExistingForProductConcrete(PriceProductTransfer $transferPriceProduct) { $priceType = $this->reader->getPriceTypeByName($transferPriceProduct->getPriceTypeName()); $priceEntities = $this->queryContainer->queryPriceEntityForProductConcrete($transferPriceProduct->getSkuProduct(), $priceType); return $priceEntities->count() > 0; }
/** * @param string $abstractSku * @param string $priceType * * @return \Generated\Shared\Transfer\PriceProductTransfer */ protected function setTransferPriceProductAbstract($abstractSku, $priceType) { $transferPriceProduct = new PriceProductTransfer(); $transferPriceProduct->setPrice(100)->setSkuProductAbstract($abstractSku)->setPriceTypeName($priceType); return $transferPriceProduct; }
/** * @api * * @param \Generated\Shared\Transfer\PriceProductTransfer $transferPriceProduct * @param \Orm\Zed\Price\Persistence\SpyPriceType $priceType * * @return \Orm\Zed\Price\Persistence\SpyPriceProductQuery */ public function querySpecificPriceForProductConcrete(PriceProductTransfer $transferPriceProduct, SpyPriceType $priceType) { return $this->getFactory()->createPriceProductQuery()->filterByPrice($transferPriceProduct->getPrice())->filterByPriceType($priceType)->useProductQuery()->filterBySku($transferPriceProduct->getSkuProduct())->endUse(); }