Пример #1
0
 /**
  * @param int $idDiscount
  *
  * @return \Generated\Shared\Transfer\DiscountVoucherTransfer|null
  */
 public function getData($idDiscount)
 {
     $discountConfiguratorTransfer = null;
     if (!$idDiscount) {
         $discountConfiguratorTransfer = new DiscountConfiguratorTransfer();
         $discountGeneralTransfer = $this->createDiscountGeneralTransferDefaults();
         $discountConfiguratorTransfer->setDiscountGeneral($discountGeneralTransfer);
         $calculatedDiscountTransfer = $this->createDiscountCalculatorTransfer();
         $discountConfiguratorTransfer->setDiscountCalculator($calculatedDiscountTransfer);
     }
     return $discountConfiguratorTransfer;
 }
Пример #2
0
 /**
  * @return \Generated\Shared\Transfer\DiscountConfiguratorTransfer
  */
 protected function createDiscountConfiguratorTransfer()
 {
     $discountConfiguratorTransfer = new DiscountConfiguratorTransfer();
     $discountGeneralTransfer = new DiscountGeneralTransfer();
     $discountGeneralTransfer->setDiscountType(DiscountConstants::TYPE_VOUCHER);
     $discountConfiguratorTransfer->setDiscountGeneral($discountGeneralTransfer);
     $discountCalculatorTransfer = new DiscountCalculatorTransfer();
     $discountConfiguratorTransfer->setDiscountCalculator($discountCalculatorTransfer);
     $discountVoucherTransfer = new DiscountVoucherTransfer();
     $discountConfiguratorTransfer->setDiscountVoucher($discountVoucherTransfer);
     $discountConditionTransfer = new DiscountConditionTransfer();
     $discountConfiguratorTransfer->setDiscountCondition($discountConditionTransfer);
     return $discountConfiguratorTransfer;
 }