<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JPSOAP_Discount StructType
 * @subpackage Structs
 */
class JPSOAP_Discount extends AbstractStructBase
{
    /**
     * The Order
     * Meta information extracted from the WSDL
     * - use: required
     * @var int
     */
    public $Order;
    /**
     * The Discount
     * Meta information extracted from the WSDL
     * - use: required
     * @var float
     */
    public $Discount;
    /**
     * Constructor method for JPSOAP_Discount
     * @uses JPSOAP_Discount::setOrder()
     * @uses JPSOAP_Discount::setDiscount()
     * @param int $order
     * @param float $discount
     */
    public function __construct($order = null, $discount = null)
    {
        $this
            ->setOrder($order)
            ->setDiscount($discount);
    }
    /**
     * Get Order value
     * @return int
     */
    public function getOrder()
    {
        return $this->Order;
    }
    /**
     * Set Order value
     * @param int $order
     * @return \StructType\JPSOAP_Discount
     */
    public function setOrder($order = null)
    {
        // validation for constraint: int
        if (!is_null($order) && !(is_int($order) || ctype_digit($order))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($order, true), gettype($order)), __LINE__);
        }
        $this->Order = $order;
        return $this;
    }
    /**
     * Get Discount value
     * @return float
     */
    public function getDiscount()
    {
        return $this->Discount;
    }
    /**
     * Set Discount value
     * @param float $discount
     * @return \StructType\JPSOAP_Discount
     */
    public function setDiscount($discount = null)
    {
        // validation for constraint: float
        if (!is_null($discount) && !(is_float($discount) || is_numeric($discount))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($discount, true), gettype($discount)), __LINE__);
        }
        $this->Discount = $discount;
        return $this;
    }
}
