/** * @param \Generated\Shared\Transfer\DiscountVoucherTransfer $discountVoucherTransfer * @param \Orm\Zed\Discount\Persistence\SpyDiscountVoucher $voucherEntity * * @return void */ protected function hydrateDiscountVoucherEntity(DiscountVoucherTransfer $discountVoucherTransfer, SpyDiscountVoucher $voucherEntity) { $voucherEntity->fromArray($discountVoucherTransfer->toArray()); $voucherEntity->setIsActive(true); }
/** * @param string $voucherCode * @param \Orm\Zed\Discount\Persistence\SpyDiscount $discountEntity * * @return \Orm\Zed\Discount\Persistence\SpyDiscountVoucher */ protected function createVoucherCode($voucherCode, SpyDiscount $discountEntity) { $voucherEntity = new SpyDiscountVoucher(); $voucherEntity->setFkDiscountVoucherPool($discountEntity->getFkDiscountVoucherPool()); $voucherEntity->setCode($voucherCode); $voucherEntity->setIsActive(true); $voucherEntity->save(); return $voucherEntity; }