/** * @param \Orm\Zed\Discount\Persistence\SpyDiscountVoucher $discountVoucherEntity * * @return bool */ protected function isValidNumberOfUses(SpyDiscountVoucher $discountVoucherEntity) { if ($discountVoucherEntity->getMaxNumberOfUses() > 0 && $discountVoucherEntity->getNumberOfUses() >= $discountVoucherEntity->getMaxNumberOfUses()) { return false; } return true; }
/** * @param \Orm\Zed\Discount\Persistence\SpyDiscountVoucher $voucherEntity * * @return bool */ protected function isVoucherWithCounter(SpyDiscountVoucher $voucherEntity) { $maxNumberOfUses = $voucherEntity->getMaxNumberOfUses(); if (!empty($maxNumberOfUses)) { return true; } return false; }