<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for OTA_HotelAvailRSHotelStaysHotelStay StructType
 * @package Dg
 * @subpackage Structs
 */
class DgOTA_HotelAvailRSHotelStaysHotelStay extends AbstractStructBase
{
    /**
     * The Availability
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgAvailability[]
     */
    public $Availability;
    /**
     * The BasicPropertyInfo
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgBasicPropertyInfoType
     */
    public $BasicPropertyInfo;
    /**
     * The RoomStayRPH
     * @var string[]
     */
    public $RoomStayRPH;
    /**
     * Constructor method for OTA_HotelAvailRSHotelStaysHotelStay
     * @uses DgOTA_HotelAvailRSHotelStaysHotelStay::setAvailability()
     * @uses DgOTA_HotelAvailRSHotelStaysHotelStay::setBasicPropertyInfo()
     * @uses DgOTA_HotelAvailRSHotelStaysHotelStay::setRoomStayRPH()
     * @param \dgsoft\StructType\DgAvailability[] $availability
     * @param \dgsoft\StructType\DgBasicPropertyInfoType $basicPropertyInfo
     * @param string[] $roomStayRPH
     */
    public function __construct(array $availability = array(), \dgsoft\StructType\DgBasicPropertyInfoType $basicPropertyInfo = null, array $roomStayRPH = array())
    {
        $this
            ->setAvailability($availability)
            ->setBasicPropertyInfo($basicPropertyInfo)
            ->setRoomStayRPH($roomStayRPH);
    }
    /**
     * Get Availability value
     * @return \dgsoft\StructType\DgAvailability[]|null
     */
    public function getAvailability()
    {
        return $this->Availability;
    }
    /**
     * Set Availability value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgAvailability[] $availability
     * @return \dgsoft\StructType\DgOTA_HotelAvailRSHotelStaysHotelStay
     */
    public function setAvailability(array $availability = array())
    {
        foreach ($availability as $oTA_HotelAvailRSHotelStaysHotelStayAvailabilityItem) {
            // validation for constraint: itemType
            if (!$oTA_HotelAvailRSHotelStaysHotelStayAvailabilityItem instanceof \dgsoft\StructType\DgAvailability) {
                throw new \InvalidArgumentException(sprintf('The Availability property can only contain items of \dgsoft\StructType\DgAvailability, "%s" given', is_object($oTA_HotelAvailRSHotelStaysHotelStayAvailabilityItem) ? get_class($oTA_HotelAvailRSHotelStaysHotelStayAvailabilityItem) : gettype($oTA_HotelAvailRSHotelStaysHotelStayAvailabilityItem)), __LINE__);
            }
        }
        $this->Availability = $availability;
        return $this;
    }
    /**
     * Add item to Availability value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgAvailability $item
     * @return \dgsoft\StructType\DgOTA_HotelAvailRSHotelStaysHotelStay
     */
    public function addToAvailability(\dgsoft\StructType\DgAvailability $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \dgsoft\StructType\DgAvailability) {
            throw new \InvalidArgumentException(sprintf('The Availability property can only contain items of \dgsoft\StructType\DgAvailability, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->Availability[] = $item;
        return $this;
    }
    /**
     * Get BasicPropertyInfo value
     * @return \dgsoft\StructType\DgBasicPropertyInfoType|null
     */
    public function getBasicPropertyInfo()
    {
        return $this->BasicPropertyInfo;
    }
    /**
     * Set BasicPropertyInfo value
     * @param \dgsoft\StructType\DgBasicPropertyInfoType $basicPropertyInfo
     * @return \dgsoft\StructType\DgOTA_HotelAvailRSHotelStaysHotelStay
     */
    public function setBasicPropertyInfo(\dgsoft\StructType\DgBasicPropertyInfoType $basicPropertyInfo = null)
    {
        $this->BasicPropertyInfo = $basicPropertyInfo;
        return $this;
    }
    /**
     * Get RoomStayRPH value
     * @return string[]|null
     */
    public function getRoomStayRPH()
    {
        return $this->RoomStayRPH;
    }
    /**
     * Set RoomStayRPH value
     * @throws \InvalidArgumentException
     * @param string[] $roomStayRPH
     * @return \dgsoft\StructType\DgOTA_HotelAvailRSHotelStaysHotelStay
     */
    public function setRoomStayRPH(array $roomStayRPH = array())
    {
        foreach ($roomStayRPH as $oTA_HotelAvailRSHotelStaysHotelStayRoomStayRPHItem) {
            // validation for constraint: itemType
            if (!is_string($oTA_HotelAvailRSHotelStaysHotelStayRoomStayRPHItem)) {
                throw new \InvalidArgumentException(sprintf('The RoomStayRPH property can only contain items of string, "%s" given', is_object($oTA_HotelAvailRSHotelStaysHotelStayRoomStayRPHItem) ? get_class($oTA_HotelAvailRSHotelStaysHotelStayRoomStayRPHItem) : gettype($oTA_HotelAvailRSHotelStaysHotelStayRoomStayRPHItem)), __LINE__);
            }
        }
        $this->RoomStayRPH = $roomStayRPH;
        return $this;
    }
    /**
     * Add item to RoomStayRPH value
     * @throws \InvalidArgumentException
     * @param string $item
     * @return \dgsoft\StructType\DgOTA_HotelAvailRSHotelStaysHotelStay
     */
    public function addToRoomStayRPH($item)
    {
        // validation for constraint: itemType
        if (!is_string($item)) {
            throw new \InvalidArgumentException(sprintf('The RoomStayRPH property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->RoomStayRPH[] = $item;
        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 \dgsoft\StructType\DgOTA_HotelAvailRSHotelStaysHotelStay
     */
    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__;
    }
}
