<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_HotelFutureRatesResults StructType
 * @subpackage Structs
 */
class JP_HotelFutureRatesResults extends AbstractStructBase
{
    /**
     * The HotelFutureRatesResult
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\JP_HotelFutureRatesResult[]
     */
    public $HotelFutureRatesResult;
    /**
     * The WarningDetails
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\JP_WarningDetails
     */
    public $WarningDetails;
    /**
     * Constructor method for JP_HotelFutureRatesResults
     * @uses JP_HotelFutureRatesResults::setHotelFutureRatesResult()
     * @uses JP_HotelFutureRatesResults::setWarningDetails()
     * @param \StructType\JP_HotelFutureRatesResult[] $hotelFutureRatesResult
     * @param \StructType\JP_WarningDetails $warningDetails
     */
    public function __construct(array $hotelFutureRatesResult = array(), \StructType\JP_WarningDetails $warningDetails = null)
    {
        $this
            ->setHotelFutureRatesResult($hotelFutureRatesResult)
            ->setWarningDetails($warningDetails);
    }
    /**
     * Get HotelFutureRatesResult value
     * @return \StructType\JP_HotelFutureRatesResult[]|null
     */
    public function getHotelFutureRatesResult()
    {
        return $this->HotelFutureRatesResult;
    }
    /**
     * Set HotelFutureRatesResult value
     * @throws \InvalidArgumentException
     * @param \StructType\JP_HotelFutureRatesResult[] $hotelFutureRatesResult
     * @return \StructType\JP_HotelFutureRatesResults
     */
    public function setHotelFutureRatesResult(array $hotelFutureRatesResult = array())
    {
        foreach ($hotelFutureRatesResult as $jP_HotelFutureRatesResultsHotelFutureRatesResultItem) {
            // validation for constraint: itemType
            if (!$jP_HotelFutureRatesResultsHotelFutureRatesResultItem instanceof \StructType\JP_HotelFutureRatesResult) {
                throw new \InvalidArgumentException(sprintf('The HotelFutureRatesResult property can only contain items of \StructType\JP_HotelFutureRatesResult, "%s" given', is_object($jP_HotelFutureRatesResultsHotelFutureRatesResultItem) ? get_class($jP_HotelFutureRatesResultsHotelFutureRatesResultItem) : gettype($jP_HotelFutureRatesResultsHotelFutureRatesResultItem)), __LINE__);
            }
        }
        $this->HotelFutureRatesResult = $hotelFutureRatesResult;
        return $this;
    }
    /**
     * Add item to HotelFutureRatesResult value
     * @throws \InvalidArgumentException
     * @param \StructType\JP_HotelFutureRatesResult $item
     * @return \StructType\JP_HotelFutureRatesResults
     */
    public function addToHotelFutureRatesResult(\StructType\JP_HotelFutureRatesResult $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\JP_HotelFutureRatesResult) {
            throw new \InvalidArgumentException(sprintf('The HotelFutureRatesResult property can only contain items of \StructType\JP_HotelFutureRatesResult, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->HotelFutureRatesResult[] = $item;
        return $this;
    }
    /**
     * Get WarningDetails value
     * @return \StructType\JP_WarningDetails|null
     */
    public function getWarningDetails()
    {
        return $this->WarningDetails;
    }
    /**
     * Set WarningDetails value
     * @param \StructType\JP_WarningDetails $warningDetails
     * @return \StructType\JP_HotelFutureRatesResults
     */
    public function setWarningDetails(\StructType\JP_WarningDetails $warningDetails = null)
    {
        $this->WarningDetails = $warningDetails;
        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\JP_HotelFutureRatesResults
     */
    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__;
    }
}
