private function validateDiscountAmount()
 {
     if (!helpers\Helper::isInt($this->discount_amount)) {
         $this->errors['discount_amount'] = 'Discount amount value must be int.';
     } elseif (!helpers\Helper::validatePercentAmount($this->discount_amount)) {
         $this->errors['discount_amount'] = 'Discount amount value must be int between 1-100.';
     }
 }
示例#2
0
 private function validateProductDiscount()
 {
     if (!helpers\Helper::isInt($this->product_discount)) {
         $this->errors['product_discount'] = 'Product discount amount value must be int.';
     } elseif (!helpers\Helper::validatePercentAmount($this->product_discount)) {
         $this->errors['product_discount'] = 'Product discount amount value must be int between 0-100.';
     }
 }