/** * Add data to rtShopVoucher object * * @param rtShopVoucher $rt_shop_voucher * @param string $comment Voucher comment * @param string $title * @return rtShopVoucher */ private function mergeData(rtShopVoucher $rt_shop_voucher, $comment = '', $title = null) { $voucher = $this->getSessionVoucherArray(); $title = is_null($title) ? 'Gift Voucher' : $title; $rt_shop_voucher->setTitle($title); $rt_shop_voucher->setDateTo(date('Y-m-d H:i:s', strtotime(sprintf("+%s days", sfConfig::get('app_rt_shop_gift_voucher_valid_for', 365))))); $rt_shop_voucher->setReductionType('dollarOff'); $rt_shop_voucher->setReductionValue($voucher['reduction_value']); $rt_shop_voucher->setMode('Single'); $rt_shop_voucher->setCount(1); $rt_shop_voucher->setStackable(false); $rt_shop_voucher->setComment($this->getSessionVoucherAsString() . chr(13) . chr(13) . $comment); return $rt_shop_voucher; }