Example #1
0
 /**
  * @param \Orm\Zed\Discount\Persistence\SpyDiscountVoucher $discountVoucherEntity
  *
  * @return int
  */
 protected function saveDiscountVoucherEntity(SpyDiscountVoucher $discountVoucherEntity)
 {
     return $discountVoucherEntity->save();
 }
 /**
  * @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;
 }