コード例 #1
0
 /**
  * @return \Generated\Shared\Transfer\DiscountGeneralTransfer
  */
 protected function createDiscountGeneralTransferDefaults()
 {
     $discountGeneralTransfer = new DiscountGeneralTransfer();
     $discountGeneralTransfer->setIsExclusive(false);
     $discountGeneralTransfer->setValidFrom(new \DateTime());
     $discountGeneralTransfer->setValidTo(new \DateTime());
     return $discountGeneralTransfer;
 }
コード例 #2
0
 /**
  * @param \Orm\Zed\Discount\Persistence\SpyDiscount $discountEntity
  *
  * @return \Generated\Shared\Transfer\DiscountGeneralTransfer
  */
 protected function hydrateGeneralDiscount(SpyDiscount $discountEntity)
 {
     $discountGeneralTransfer = new DiscountGeneralTransfer();
     $discountGeneralTransfer->fromArray($discountEntity->toArray(), true);
     $discountGeneralTransfer->setValidFrom($discountEntity->getValidFrom());
     $discountGeneralTransfer->setValidTo($discountEntity->getValidTo());
     return $discountGeneralTransfer;
 }
コード例 #3
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;
 }