Пример #1
0
 /**
  * @param string $code
  *
  * @return bool
  */
 public function isUsable($code)
 {
     $discountVoucherEntity = $this->discountQueryContainer->queryVoucher($code)->findOne();
     if (!$discountVoucherEntity) {
         $this->addMessage(self::REASON_VOUCHER_CODE_NOT_FOUND);
         return false;
     }
     return $this->validateDiscountVoucher($discountVoucherEntity);
 }
Пример #2
0
 /**
  * @param string $code
  *
  * @return \Orm\Zed\Discount\Persistence\SpyDiscountVoucher
  */
 protected function getDiscountVoucherEntityByCode($code)
 {
     return $this->discountQueryContainer->queryVoucher($code)->findOne();
 }