<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JPSOAP_LengthOfStay StructType
 * @subpackage Structs
 */
class JPSOAP_LengthOfStay extends JPSOAP_DateIntervals
{
    /**
     * The MinNights
     * @var int
     */
    public $MinNights;
    /**
     * The MaxNights
     * @var int
     */
    public $MaxNights;
    /**
     * Constructor method for JPSOAP_LengthOfStay
     * @uses JPSOAP_LengthOfStay::setMinNights()
     * @uses JPSOAP_LengthOfStay::setMaxNights()
     * @param int $minNights
     * @param int $maxNights
     */
    public function __construct($minNights = null, $maxNights = null)
    {
        $this
            ->setMinNights($minNights)
            ->setMaxNights($maxNights);
    }
    /**
     * Get MinNights value
     * @return int|null
     */
    public function getMinNights()
    {
        return $this->MinNights;
    }
    /**
     * Set MinNights value
     * @param int $minNights
     * @return \StructType\JPSOAP_LengthOfStay
     */
    public function setMinNights($minNights = null)
    {
        // validation for constraint: int
        if (!is_null($minNights) && !is_numeric($minNights)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($minNights)), __LINE__);
        }
        $this->MinNights = $minNights;
        return $this;
    }
    /**
     * Get MaxNights value
     * @return int|null
     */
    public function getMaxNights()
    {
        return $this->MaxNights;
    }
    /**
     * Set MaxNights value
     * @param int $maxNights
     * @return \StructType\JPSOAP_LengthOfStay
     */
    public function setMaxNights($maxNights = null)
    {
        // validation for constraint: int
        if (!is_null($maxNights) && !is_numeric($maxNights)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($maxNights)), __LINE__);
        }
        $this->MaxNights = $maxNights;
        return $this;
    }
    /**
     * Method called when an object has been exported with var_export() functions
     * It allows to return an object instantiated with the values
     * @see AbstractStructBase::__set_state()
     * @uses AbstractStructBase::__set_state()
     * @param array $array the exported values
     * @return \StructType\JPSOAP_LengthOfStay
     */
    public static function __set_state(array $array)
    {
        return parent::__set_state($array);
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
