/** * @return \Generated\Shared\Transfer\DiscountGeneralTransfer */ protected function createDiscountGeneralTransferDefaults() { $discountGeneralTransfer = new DiscountGeneralTransfer(); $discountGeneralTransfer->setIsExclusive(false); $discountGeneralTransfer->setValidFrom(new \DateTime()); $discountGeneralTransfer->setValidTo(new \DateTime()); return $discountGeneralTransfer; }
/** * @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; }
/** * @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; }