<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for OTA_AirSeatMapRSSeatMapResponses StructType
 * @package Dg
 * @subpackage Structs
 */
class DgOTA_AirSeatMapRSSeatMapResponses extends AbstractStructBase
{
    /**
     * The SeatMapResponse
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse[]
     */
    public $SeatMapResponse;
    /**
     * The AirTravelers
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \dgsoft\ArrayType\DgArrayOfOTA_AirSeatMapRSSeatMapResponsesAirTraveler
     */
    public $AirTravelers;
    /**
     * Constructor method for OTA_AirSeatMapRSSeatMapResponses
     * @uses DgOTA_AirSeatMapRSSeatMapResponses::setSeatMapResponse()
     * @uses DgOTA_AirSeatMapRSSeatMapResponses::setAirTravelers()
     * @param \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse[] $seatMapResponse
     * @param \dgsoft\ArrayType\DgArrayOfOTA_AirSeatMapRSSeatMapResponsesAirTraveler $airTravelers
     */
    public function __construct(array $seatMapResponse = array(), \dgsoft\ArrayType\DgArrayOfOTA_AirSeatMapRSSeatMapResponsesAirTraveler $airTravelers = null)
    {
        $this
            ->setSeatMapResponse($seatMapResponse)
            ->setAirTravelers($airTravelers);
    }
    /**
     * Get SeatMapResponse value
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse[]|null
     */
    public function getSeatMapResponse()
    {
        return $this->SeatMapResponse;
    }
    /**
     * Set SeatMapResponse value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse[] $seatMapResponse
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponses
     */
    public function setSeatMapResponse(array $seatMapResponse = array())
    {
        foreach ($seatMapResponse as $oTA_AirSeatMapRSSeatMapResponsesSeatMapResponseItem) {
            // validation for constraint: itemType
            if (!$oTA_AirSeatMapRSSeatMapResponsesSeatMapResponseItem instanceof \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse) {
                throw new \InvalidArgumentException(sprintf('The SeatMapResponse property can only contain items of \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse, "%s" given', is_object($oTA_AirSeatMapRSSeatMapResponsesSeatMapResponseItem) ? get_class($oTA_AirSeatMapRSSeatMapResponsesSeatMapResponseItem) : gettype($oTA_AirSeatMapRSSeatMapResponsesSeatMapResponseItem)), __LINE__);
            }
        }
        $this->SeatMapResponse = $seatMapResponse;
        return $this;
    }
    /**
     * Add item to SeatMapResponse value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse $item
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponses
     */
    public function addToSeatMapResponse(\dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse) {
            throw new \InvalidArgumentException(sprintf('The SeatMapResponse property can only contain items of \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->SeatMapResponse[] = $item;
        return $this;
    }
    /**
     * Get AirTravelers value
     * @return \dgsoft\ArrayType\DgArrayOfOTA_AirSeatMapRSSeatMapResponsesAirTraveler|null
     */
    public function getAirTravelers()
    {
        return $this->AirTravelers;
    }
    /**
     * Set AirTravelers value
     * @param \dgsoft\ArrayType\DgArrayOfOTA_AirSeatMapRSSeatMapResponsesAirTraveler $airTravelers
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponses
     */
    public function setAirTravelers(\dgsoft\ArrayType\DgArrayOfOTA_AirSeatMapRSSeatMapResponsesAirTraveler $airTravelers = null)
    {
        $this->AirTravelers = $airTravelers;
        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_AirSeatMapRSSeatMapResponses
     */
    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__;
    }
}
